第三方中间件
这里列出的是部分 Express 中间件组件:
- body-parser: previously
express.bodyParser,json, andurlencoded. See also: - compression - previously
express.compress - connect-image-optimus: Connect/Express middleware for optimal image serving. Switches to webp/jpegxr if possible.
- connect-timeout: previously
express.timeout - cookie-parser: previously
express.cookieParser - cookie-session: previously
express.cookieSession - csurf: previousy
express.csrf - errorhandler: previously
express.errorHandler - express-debug: unobtrusive development tool that adds a tab with information about req, session, locals, and more to your application.
- express-partial-response: Express middleware for filtering-out parts of JSON responses based on the
fieldsquery-string; using Google API’s Partial Response. - express-session: previously
express.session - express-simple-cdn: easily use a CDN for your static assets, with multiple host support (ex. cdn1.host.com, cdn2.host.com).
- express-slash: Express middleware for people who are strict about trailing slashes.
- express-stormpath: Express middleware for user storage, authentication, authorization, SSO, and data security.
- express-uncapitalize: redirect HTTP requests containing uppercase to a canonical lowercase form.
- join-io: join files on a fly to reduce requests count
- method-override: previously
express.methodOverride - morgan: previously
logger - passport: Express middleware for authentication.
- response-time: previously
express.responseTime - serve-favicon: previously
express.favicon - serve-index: previousy
express.directory - serve-static: for serving static content
- static-expiry: fingerprinted URLs/Caching Headers for static assets including external domain(s) support.
- vhost: previously
express.vhost - view-helpers: An express middleware that provides common helper methods to the views.
Some middleware previously included with Connect are no longer supported by the Connect/Express team, and are replaced by an alternative module, or should be superseded by a better module. Use one of these alternatives instead:
- express.cookieParser
- express.limit
- express.multipart
- express.query
- express.staticCache
For more middleware, see also: - http-framework - expressjs