///
import Service from './service';
export default class ConfigService extends Service {
protected _config: AppConfig;
readonly environment: string;
get(p1: T1): S[T1];
get(p1: T1, p2: T2): S[T1][T2];
get(p1: T1, p2: T2, p3: T3): S[T1][T2][T3];
get(p1: T1, p2: T2, p3: T3, p4: T4): S[T1][T2][T3][T4];
get(p1: T1, p2: T2, p3: T3, p4: T4, p5: T5): S[T1][T2][T3][T4][T5];
get(p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): S[T1][T2][T3][T4][T5][T6];
get(p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): S[T1][T2][T3][T4][T5][T6][T7];
getWithDefault(p1: T1, defaultValue: any): S[T1];
getWithDefault(p1: T1, p2: T2, defaultValue: any): S[T1][T2];
getWithDefault(p1: T1, p2: T2, p3: T3, defaultValue: any): S[T1][T2][T3];
getWithDefault(p1: T1, p2: T2, p3: T3, p4: T4, defaultValue: any): S[T1][T2][T3][T4];
getWithDefault(p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, defaultValue: any): S[T1][T2][T3][T4][T5];
getWithDefault(p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, defaultValue: any): S[T1][T2][T3][T4][T5][T6];
getWithDefault(p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7, defaultValue: any): S[T1][T2][T3][T4][T5][T6][T7];
}
export interface AppConfig {
/**
* The name of the current environment, i.e. 'developement', 'test', 'production'
*/
environment: string;
logging?: {
/**
* Should logs show debug information? If true, errors will log out as much detail as possible.
*/
showDebuggingInfo?: boolean;
/**
* A morgan log format string to use
*/
format?: string;
/**
* A function to determine whether or not logging should be skipped for a given request - see
* morgan docs for details
*/
skip?(): boolean;
};
/**
* Cookie parser configuration - see cookie-parser for details
*/
cookies?: any;
/**
* CORS configuration - see cors middleware package for details
*/
cors?: any;
migrations?: {
/**
* Knex configuration information for running migrations
*/
db?: any;
};
server: {
/**
* THe port number that the application should start up on
*/
port?: number;
/**
* Should the application start in detached mode? I.e. without attaching to a port?
*/
detached?: boolean;
/**
* SSL/TLS certificate files. Note these should be the file contents, not the file paths
*/
ssl?: {
key: Buffer | string;
cert: Buffer | string;
};
trustProxy?: string | string[] | ((addr?: string, i?: number) => boolean);
subdomainOffset?: number;
};
/**
* Connection and configuration for your ORM adapter - see your ORM adapter docs for
* details
*/
database?: any;
[key: string]: any;
}