Express.js logo Express.js logo
Nodejs.cn 旗下网站

Express middleware

The Express middleware modules listed here are maintained by the Expressjs team.

Middleware module Description
body-parser Parse HTTP request body.
compression Compress HTTP responses.
connect-rid Generate unique request ID.
cookie-parser Parse cookie header and populate req.cookies. See also cookies.
cookie-session Establish cookie-based sessions.
cors Enable cross-origin resource sharing (CORS) with various options.
errorhandler Development error-handling/debugging.
method-override Override HTTP methods using header.
morgan HTTP request logger.
multer Handle multi-part form data.
response-time Record HTTP response time.
serve-favicon Serve a favicon.
serve-index Serve directory listing for a given path.
serve-static Serve static files.
session Establish server-based sessions (development only).
timeout Set a timeout perioHTTP request processing.
vhost Create virtual domains.

Additional middleware modules

These are some additional popular middleware modules.

警告

此信息涉及非 Expressjs 团队维护的第三方网站、产品或模块。此处列出并不代表 Expressjs 项目团队的认可或推荐。

Middleware module Description
helmet Helps secure your apps by setting various HTTP headers.
passport Authentication using “strategies” such as OAuth, OpenID and many others. See passportjs.org for more information.