Express Docs:查阅 Express 5.x 的路由、中间件与 API 说明
首页与版本
Express 官网首页写着 “Fast, unopinionated, minimalist web framework for Node.js”,框架版本显示为 5.3.0。首页给出安装命令 npm install express,以及一段用 app.get('/') 返回 “Hello World!” 的示例代码,并有 Get Started 按钮。首页下方介绍了四个方面:Web Applications、APIs、Performance 和 Middleware。

截图中的横幅是 2026 年 9 月的安全更新公告;截至 2026 年 10 月,官网横幅改为 body-parser 中间件的拒绝服务漏洞公告(CVE-2026-111181)。
文档的分组
左侧目录的 Getting started 包括 Installing、Hello world、Express generator、Basic routing、Serving static files、Examples 和 FAQ。Guide 分组包括 Routing、Writing middleware、Using middleware、Using template engines、Error handling、Debugging、Behind proxies 和 Database integration,并有 Migration guides,其下的 Moving to Express 4 与 Moving to Express 5 说明版本迁移。Advanced topics 下有 Building template engines、Performance best practices、Security best practices 和 Health checks & graceful shutdown。
API 分组按对象组织,包括 express()、Application、Request、Response 和 Router。Middleware 分组列出 body-parser、compression、cookie-parser、cookie-session、cors、multer、morgan、session 等中间件的说明页。
覆盖 Express API 的页面
Guide 中的 Overriding the Express API 页面讲解如何扩展请求和响应对象。页面说明有两个扩展点:全局原型 express.request 与 express.response,以及应用级原型 app.request 与 app.response;修改全局原型会影响同一进程中所有已加载的应用。

页面的示例把 res.sendStatus 改为接受状态码、编码类型和消息体三个参数的新函数,并说明这会改变原有签名。页面还指出,req.baseUrl、req.originalUrl 这类赋值属性无法覆盖,而 req.ip、req.secure 这类 getter 属性可以覆盖,并给出一个改为读取 Client-IP 请求头的 req.ip 示例。TypeScript 部分说明需要扩展 express-serve-static-core 的类型声明。