library: { name: "express", versions: ">=4 <6" } and reads Express 4 and 5, including the Express 5 path syntax. It only narrates files that import or require Express or belong to a package that depends on it (see Dependency detection), so a Map#get or another library’s app.get is left alone.
Examples
The hello-world app
English
A route with middleware and error handling
English
Middleware and an error handler
English
What it covers
- Apps and routers:
express(),express.Router(),app.route(path)chains,app.listen, settings such asapp.setandapp.disable, and mounting routers withapp.use(path, router). - Routes: every HTTP method and
all, route-level middleware (“after auth”), and one-line handlers that read inline. - Middleware: the built-in
express.json,express.urlencodedandexpress.static, common packages such ascors,helmet,morgan,cookie-parser,compression,express-rate-limitandexpress-sessionby what they do, inline middleware aroundnext(), and error handlers. - The request: path and query parameters, headers, the body and cookies.
- The response:
send,json,status,sendStatus,redirect,render, cookies, headers, downloads and files, andnext(err).
Translating
The English phrasebook is exported asen and typed as ExpressPhrases.