NestExpressApplication
Interface describing methods on NestExpressApplication.
interface NestExpressApplication<TServer extends CoreHttpServer | CoreHttpsServer = CoreHttpServer> extends INestApplication {
getHttpAdapter(): HttpServer<Express.Request, Express.Response, Express>
listen(port: string | number, callback?: () => void): Promise<TServer>
set(...args: any[]): this
engine(...args: any[]): this
enable(...args: any[]): this
disable(...args: any[]): this
useStaticAssets(options: ServeStaticOptions): this
enableCors(options?: any): void
useBodyParser<Options = NestExpressBodyParserOptions>(parser: NestExpressBodyParserType, options?: Omit<Options, "verify">): this
setBaseViewsDir(path: string | string[]): this
setViewEngine(engine: string): this
setLocal(key: string, value: any): this
}
See also
Methods
getHttpAdapter() |
---|
Returns the underlying HTTP adapter bounded to the Express.js app. |
ParametersThere are no parameters. Returns
|
listen() |
---|
Starts the application. |
set() |
---|
A wrapper function around native |
engine() |
---|
A wrapper function around native |
enable() |
---|
A wrapper function around native |
disable() |
---|
A wrapper function around native |
useStaticAssets() | |||||||||
---|---|---|---|---|---|---|---|---|---|
Sets a base directory for public assets.
Parameters
Returns
|
enableCors() |
---|
useBodyParser() | |||||||||
---|---|---|---|---|---|---|---|---|---|
Register Express body parsers on the fly. Will respect
the application's |
|||||||||
Parameters
Examples
Returns
|
setBaseViewsDir() |
---|
Sets one or multiple base directories for templates (views). |
setViewEngine() | ||||||
---|---|---|---|---|---|---|
Sets a view engine for templates (views). |
||||||
Parameters
Examples
Returns
|
setLocal() | |||||||||
---|---|---|---|---|---|---|---|---|---|
Sets app-level globals for view templates. |
|||||||||
Parameters
Examples
Returns
|