mirror of
https://github.com/dotFionn/iassure-wx.git
synced 2026-03-16 04:22:56 -05:00
29 lines
562 B
TypeScript
29 lines
562 B
TypeScript
export interface Config {
|
|
port: number;
|
|
apiBasePath: string;
|
|
disableDefaultApiEndpoint: boolean;
|
|
trustProxy: string | boolean;
|
|
}
|
|
|
|
export default function appConfig(): Config {
|
|
const {
|
|
PORT,
|
|
BASE_PATH,
|
|
TRUST_PROXY,
|
|
DISABLE_DEFAULT_API_ENDPOINT,
|
|
} = process.env;
|
|
|
|
let trustProxy: string | boolean = false;
|
|
|
|
if (TRUST_PROXY == '*') {
|
|
trustProxy = true;
|
|
}
|
|
|
|
return {
|
|
port: Number(PORT ?? 3000),
|
|
apiBasePath: BASE_PATH ?? '',
|
|
trustProxy,
|
|
disableDefaultApiEndpoint: DISABLE_DEFAULT_API_ENDPOINT == 'true',
|
|
};
|
|
}
|