@nestjs/platform-express
Advanced tools
Comparing version 6.5.3 to 6.6.0
@@ -12,2 +12,3 @@ import { RequestMethod } from '@nestjs/common'; | ||
render(response: any, view: string, options: any): any; | ||
redirect(response: any, statusCode: number, url: string): any; | ||
setErrorHandler(handler: Function): any; | ||
@@ -14,0 +15,0 @@ setNotFoundHandler(handler: Function): any; |
@@ -31,2 +31,5 @@ "use strict"; | ||
} | ||
redirect(response, statusCode, url) { | ||
return response.redirect(statusCode, url); | ||
} | ||
setErrorHandler(handler) { | ||
@@ -33,0 +36,0 @@ return this.use(handler); |
import { INestApplication } from '@nestjs/common'; | ||
import { ServeStaticOptions } from './serve-static-options.interface'; | ||
/** | ||
* Interface describing methods on NestExpressApplication. | ||
* | ||
* @see [Platform](https://docs.nestjs.com/first-steps#platform) | ||
* | ||
* @publicApi | ||
*/ | ||
export interface NestExpressApplication extends INestApplication { | ||
/** | ||
* A wrapper function around native `express.set()` method. | ||
* Example `app.set('trust proxy', 'loopback')` | ||
* | ||
* @example | ||
* app.set('trust proxy', 'loopback') | ||
* | ||
* @returns {this} | ||
@@ -13,3 +22,4 @@ */ | ||
* A wrapper function around native `express.engine()` method. | ||
* Example `app.engine('mustache', mustacheExpress())` | ||
* @example | ||
* app.engine('mustache', mustacheExpress()) | ||
* | ||
@@ -21,3 +31,4 @@ * @returns {this} | ||
* A wrapper function around native `express.enable()` method. | ||
* Example `app.enable('x-powered-by')` | ||
* @example | ||
* app.enable('x-powered-by') | ||
* | ||
@@ -29,19 +40,24 @@ * @returns {this} | ||
* A wrapper function around native `express.disable()` method. | ||
* Example `app.disable('x-powered-by')` | ||
* | ||
* @example | ||
* app.disable('x-powered-by') | ||
* | ||
* @returns {this} | ||
*/ | ||
disable(...args: any[]): this; | ||
useStaticAssets(options: ServeStaticOptions): this; | ||
/** | ||
* Sets a base directory for public assets. | ||
* Example `app.useStaticAssets('public') | ||
* @example | ||
* app.useStaticAssets('public') | ||
* | ||
* @returns {this} | ||
*/ | ||
useStaticAssets(options: ServeStaticOptions): this; | ||
useStaticAssets(path: string, options?: ServeStaticOptions): this; | ||
/** | ||
* Sets one or multiple base directories for templates (views). | ||
* Example `app.setBaseViewsDir('views')` | ||
* | ||
* @example | ||
* app.setBaseViewsDir('views') | ||
* | ||
* @returns {this} | ||
@@ -52,3 +68,4 @@ */ | ||
* Sets a view engine for templates (views). | ||
* Example `app.setViewEngine('pug')` | ||
* @example | ||
* app.setViewEngine('pug') | ||
* | ||
@@ -55,0 +72,0 @@ * @returns {this} |
/** | ||
* @see https://www.npmjs.com/package/@types/serve-static | ||
* Interface describing options for serving static assets. | ||
* | ||
* @see [Serving static files in Express](https://expressjs.com/en/starter/static-files.html) | ||
* @see [Model-View-Controller](https://docs.nestjs.com/techniques/mvc) | ||
* | ||
* @publicApi | ||
*/ | ||
@@ -54,6 +59,6 @@ export interface ServeStaticOptions { | ||
* Function to set custom headers on response. Alterations to the headers need to occur synchronously. | ||
* The function is called as fn(res, path, stat), where the arguments are: | ||
* res the response object | ||
* path the file path that is being sent | ||
* stat the stat object of the file that is being sent | ||
* The function is called as `fn(res, path, stat)`, where the arguments are: | ||
* `res` - the response object | ||
* `path` - the file path that is being sent | ||
* `stat` - the stat object of the file that is being sent | ||
*/ | ||
@@ -60,0 +65,0 @@ setHeaders?: (res: any, path: string, stat: any) => any; |
@@ -28,5 +28,5 @@ /// <reference types="node" /> | ||
headerPairs?: number; | ||
/** Keep the full path of files instead of just the base name (Default: false) */ | ||
preservePath?: boolean; | ||
}; | ||
/** Keep the full path of files instead of just the base name (Default: false) */ | ||
preservePath?: boolean; | ||
fileFilter?(req: any, file: { | ||
@@ -33,0 +33,0 @@ /** Field name specified in the form */ |
{ | ||
"name": "@nestjs/platform-express", | ||
"version": "6.5.3", | ||
"version": "6.6.0", | ||
"description": "Nest - modern, fast, powerful node.js web framework (@platform-express)", | ||
@@ -5,0 +5,0 @@ "author": "Kamil Mysliwiec", |
@@ -5,8 +5,6 @@ <p align="center"> | ||
[travis-image]: https://api.travis-ci.org/nestjs/nest.svg?branch=master | ||
[travis-url]: https://travis-ci.org/nestjs/nest | ||
[linux-image]: https://img.shields.io/travis/nestjs/nest/master.svg?label=linux | ||
[linux-url]: https://travis-ci.org/nestjs/nest | ||
[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456 | ||
[circleci-url]: https://circleci.com/gh/nestjs/nest | ||
<p align="center">A progressive <a href="http://nodejs.org" target="_blank">Node.js</a> framework for building efficient and scalable server-side applications, heavily inspired by <a href="https://angular.io" target="blank">Angular</a>.</p> | ||
<p align="center">A progressive <a href="http://nodejs.org" target="_blank">Node.js</a> framework for building efficient and scalable server-side applications.</p> | ||
<p align="center"> | ||
@@ -16,4 +14,3 @@ <a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a> | ||
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/dm/@nestjs/core.svg" alt="NPM Downloads" /></a> | ||
<a href="https://travis-ci.org/nestjs/nest" target="_blank"><img src="https://api.travis-ci.org/nestjs/nest.svg?branch=master" alt="Travis" /></a> | ||
<a href="https://travis-ci.org/nestjs/nest" target="_blank"><img src="https://img.shields.io/travis/nestjs/nest/master.svg?label=linux" alt="Linux" /></a> | ||
<a href="https://circleci.com/gh/nestjs/nest" target="_blank"><img src="https://img.shields.io/circleci/build/github/nestjs/nest/master" alt="CircleCI" /></a> | ||
<a href="https://coveralls.io/github/nestjs/nest?branch=master" target="_blank"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#9" alt="Coverage" /></a> | ||
@@ -20,0 +17,0 @@ <a href="https://discord.gg/G7Qnnhy" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
47110
719
87