模版下 server文件配置
This commit is contained in:
parent
7e72576914
commit
46cf0e9ab2
|
|
@ -1,4 +1,4 @@
|
|||
import accessConfiguration from './access.dev';
|
||||
export default accessConfiguration;
|
||||
export * from './access.dev';
|
||||
|
||||
console.log('不应该跑到这里');
|
||||
|
|
@ -1,22 +1,28 @@
|
|||
import { ServerConfiguration } from 'oak-domain/lib/types/Configuration';
|
||||
import { join } from 'path';
|
||||
import { nginxServerProxyPath, nginxSocketProxyPath, port } from './common';
|
||||
import { hostname } from './access';
|
||||
import { ssl as sslProd } from './access.prod';
|
||||
import { ssl as sslStaging } from './access.staging';
|
||||
import { hostname as hostnameDev } from './access.dev';
|
||||
import { ssl as sslProd, hostname as hostnameProd } from './access.prod';
|
||||
import { ssl as sslStaging, hostname as hostnameStaging } from './access.staging';
|
||||
|
||||
const NgixConfDict: Record<string, ServerConfiguration['nginx']> = {
|
||||
'staging': {
|
||||
const HostnameDict: Record<string, string> = {
|
||||
staging: hostnameStaging,
|
||||
production: hostnameProd,
|
||||
development: hostnameDev,
|
||||
};
|
||||
|
||||
const NginxConfDict: Record<string, ServerConfiguration['nginx']> = {
|
||||
staging: {
|
||||
ssl: sslStaging,
|
||||
apiPath: nginxServerProxyPath,
|
||||
socketPath: nginxSocketProxyPath,
|
||||
},
|
||||
'production': {
|
||||
production: {
|
||||
ssl: sslProd,
|
||||
apiPath: nginxServerProxyPath,
|
||||
socketPath: nginxSocketProxyPath,
|
||||
},
|
||||
'development': undefined,
|
||||
development: undefined,
|
||||
};
|
||||
|
||||
const serverConfiguration: ServerConfiguration = {
|
||||
|
|
@ -25,8 +31,8 @@ const serverConfiguration: ServerConfiguration = {
|
|||
path: join(__dirname, '..', '..'),
|
||||
},
|
||||
port,
|
||||
hostname,
|
||||
nginx: NgixConfDict[process.env.NODE_ENV as string],
|
||||
hostname: HostnameDict[process.env.NODE_ENV as string],
|
||||
nginx: NginxConfDict[process.env.NODE_ENV as string],
|
||||
};
|
||||
|
||||
export default serverConfiguration;
|
||||
|
|
|
|||
Loading…
Reference in New Issue