mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-03 02:20:19 +08:00
feat(infra): framework
This commit is contained in:
@@ -2,7 +2,6 @@ export * from './error';
|
||||
export * from './fetcher';
|
||||
export * from './graphql';
|
||||
export * from './schema';
|
||||
export * from './utils';
|
||||
|
||||
import { setupGlobal } from '@affine/env/global';
|
||||
|
||||
@@ -14,6 +13,10 @@ export function getBaseUrl(): string {
|
||||
if (environment.isDesktop) {
|
||||
return runtimeConfig.serverUrlPrefix;
|
||||
}
|
||||
if (typeof window === 'undefined') {
|
||||
// is nodejs
|
||||
return '';
|
||||
}
|
||||
const { protocol, hostname, port } = window.location;
|
||||
return `${protocol}//${hostname}${port ? `:${port}` : ''}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user