mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-17 01:56:27 +08:00
refactor(server): config system (#11081)
This commit is contained in:
@@ -1,15 +1,20 @@
|
||||
import { defineStartupConfig, ModuleConfig } from '../../base/config';
|
||||
import { defineModuleConfig } from '../../base';
|
||||
|
||||
export interface WorkerStartupConfigurations {
|
||||
allowedOrigin: string[];
|
||||
}
|
||||
|
||||
declare module '../config' {
|
||||
interface PluginsConfig {
|
||||
worker: ModuleConfig<WorkerStartupConfigurations>;
|
||||
declare global {
|
||||
interface AppConfigSchema {
|
||||
worker: {
|
||||
allowedOrigin: ConfigItem<string[]>;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
defineStartupConfig('plugins.worker', {
|
||||
allowedOrigin: ['localhost', '127.0.0.1'],
|
||||
defineModuleConfig('worker', {
|
||||
allowedOrigin: {
|
||||
desc: 'Allowed origin',
|
||||
default: ['localhost', '127.0.0.1'],
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user