mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-12 07:36:42 +08:00
91c3040db7
Co-authored-by: himself65 <himself65@outlook.com>
52 lines
1.1 KiB
TypeScript
52 lines
1.1 KiB
TypeScript
import pkg from '../../package.json' assert { type: 'json' };
|
|
import type { AFFiNEConfig } from './def';
|
|
|
|
export const getDefaultAFFiNEConfig: () => AFFiNEConfig = () => ({
|
|
version: pkg.version,
|
|
ENV_MAP: {},
|
|
env: process.env.NODE_ENV ?? 'development',
|
|
get prod() {
|
|
return this.env === 'production';
|
|
},
|
|
get dev() {
|
|
return this.env === 'development';
|
|
},
|
|
get test() {
|
|
return this.env === 'test';
|
|
},
|
|
get deploy() {
|
|
return !this.dev && !this.test;
|
|
},
|
|
https: false,
|
|
host: 'localhost',
|
|
port: 3000,
|
|
path: '',
|
|
get origin() {
|
|
return this.dev
|
|
? 'http://localhost:8080'
|
|
: `${this.https ? 'https' : 'http'}://${this.host}${
|
|
this.host === 'localhost' ? `:${this.port}` : ''
|
|
}`;
|
|
},
|
|
get baseUrl() {
|
|
return `${this.origin}${this.path}`;
|
|
},
|
|
graphql: {
|
|
buildSchemaOptions: {
|
|
numberScalarMode: 'integer',
|
|
},
|
|
introspection: true,
|
|
playground: true,
|
|
debug: true,
|
|
},
|
|
auth: {
|
|
enableSignup: true,
|
|
enableOauth: false,
|
|
oauthProviders: {},
|
|
},
|
|
objectStorage: {
|
|
enable: false,
|
|
config: {},
|
|
},
|
|
});
|