59 lines
1.3 KiB
TypeScript
59 lines
1.3 KiB
TypeScript
import { useConfig } from '@kevisual/use-config';
|
|
import { useFileStore } from '@kevisual/use-config';
|
|
import { minioResources } from './s3.ts';
|
|
import { proxyDomain } from './domain.ts';
|
|
|
|
export const config = useConfig() as any;
|
|
export const port = config.PORT ? Number(config.PORT) : 4005;
|
|
export const fileStore = useFileStore('pages');
|
|
type ConfigType = {
|
|
apiList: {
|
|
path: string;
|
|
/**
|
|
* url或者相对路径
|
|
*/
|
|
target: string;
|
|
/**
|
|
* 类型
|
|
*/
|
|
type?: 'static' | 'dynamic' | 'minio';
|
|
}[];
|
|
proxy: {
|
|
/**
|
|
* self domain kevisual.xiongxiao.me
|
|
*/
|
|
domain?: string;
|
|
/**
|
|
* self ip
|
|
*/
|
|
ip?: string;
|
|
/**
|
|
* resources path
|
|
* https://minio.xiongxiao.me/resources
|
|
*/
|
|
resources: string;
|
|
/**
|
|
* allow origin xiongxiao.me zxj.im silkyai.cn
|
|
* 允许跨域访问的地址
|
|
*/
|
|
allowedOrigin: string[];
|
|
};
|
|
};
|
|
export const myConfig: ConfigType = {
|
|
apiList: [
|
|
// {
|
|
// path: '/api',
|
|
// target: config.API_HOST,
|
|
// },
|
|
{
|
|
path: '/client',
|
|
target: config.API_CLIENT_HOST || 'http://localhost:51515',
|
|
},
|
|
],
|
|
proxy: {
|
|
domain: proxyDomain as string,
|
|
resources: minioResources,
|
|
allowedOrigin: (config.PROXY_ALLOWED_ORIGINS as string)?.split(',') || [],
|
|
}
|
|
};
|