From 856281c2487b684211702bf329e025265c0a8ba4 Mon Sep 17 00:00:00 2001 From: krzysdz Date: Sat, 8 Aug 2026 13:16:13 +0200 Subject: [PATCH] fix: make all tables scrollable Markdown tables are automatically wrapped in .table-scroller div, but raw HTML tables have to be wrapped manually. Tables in migrating-4.mdx were simple an have been rewritten using markdown syntax. --- .../docs/en/4x/guide/behind-proxies.mdx | 2 + .../docs/en/5x/guide/behind-proxies.mdx | 2 + src/content/pages/en/guide/migrating-4.mdx | 231 +++--------------- 3 files changed, 36 insertions(+), 199 deletions(-) diff --git a/src/content/docs/en/4x/guide/behind-proxies.mdx b/src/content/docs/en/4x/guide/behind-proxies.mdx index dd1f1d00df..ba088fb210 100644 --- a/src/content/docs/en/4x/guide/behind-proxies.mdx +++ b/src/content/docs/en/4x/guide/behind-proxies.mdx @@ -17,6 +17,7 @@ the combination of the setting in Express matches how the reverse proxy operates The application setting `trust proxy` may be set to one of the values listed in the following table. +
@@ -89,6 +90,7 @@ app.set('trust proxy', (ip: string) => {
TypeValue
+
Enabling `trust proxy` will have the following impact: diff --git a/src/content/docs/en/5x/guide/behind-proxies.mdx b/src/content/docs/en/5x/guide/behind-proxies.mdx index dd1f1d00df..ba088fb210 100644 --- a/src/content/docs/en/5x/guide/behind-proxies.mdx +++ b/src/content/docs/en/5x/guide/behind-proxies.mdx @@ -17,6 +17,7 @@ the combination of the setting in Express matches how the reverse proxy operates The application setting `trust proxy` may be set to one of the values listed in the following table. +
@@ -89,6 +90,7 @@ app.set('trust proxy', (ip: string) => {
TypeValue
+
Enabling `trust proxy` will have the following impact: diff --git a/src/content/pages/en/guide/migrating-4.mdx b/src/content/pages/en/guide/migrating-4.mdx index 730fb0cd26..612cc24bad 100644 --- a/src/content/pages/en/guide/migrating-4.mdx +++ b/src/content/pages/en/guide/migrating-4.mdx @@ -43,133 +43,23 @@ middleware that is required to run your app. Simply follow these steps: The following table lists Express 3 middleware and their counterparts in Express 4. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Express 3Express 4
- express.bodyParser - - body-parser + - multer -
- express.compress - - compression -
- express.cookieSession - - cookie-session -
- express.cookieParser - - cookie-parser -
- express.logger - - morgan -
- express.session - - express-session -
- express.favicon - - serve-favicon -
- express.responseTime - - response-time -
- express.errorHandler - - errorhandler -
- express.methodOverride - - method-override -
- express.timeout - - connect-timeout -
- express.vhost - - vhost -
- express.csrf - - csurf -
- express.directory - - serve-index -
- express.static - - serve-static -
+| Express 3 | Express 4 | +| ------------------------ | ------------------------------------------------------------------------------------------------------- | +| `express.bodyParser` | [body-parser](https://github.com/expressjs/body-parser) + [multer](https://github.com/expressjs/multer) | +| `express.compress` | [compression](https://github.com/expressjs/compression) | +| `express.cookieSession` | [cookie-session](https://github.com/expressjs/cookie-session) | +| `express.cookieParser` | [cookie-parser](https://github.com/expressjs/cookie-parser) | +| `express.logger` | [morgan](https://github.com/expressjs/morgan) | +| `express.session` | [express-session](https://github.com/expressjs/session) | +| `express.favicon` | [serve-favicon](https://github.com/expressjs/serve-favicon) | +| `express.responseTime` | [response-time](https://github.com/expressjs/response-time) | +| `express.errorHandler` | [errorhandler](https://github.com/expressjs/errorhandler) | +| `express.methodOverride` | [method-override](https://github.com/expressjs/method-override) | +| `express.timeout` | [connect-timeout](https://github.com/expressjs/timeout) | +| `express.vhost` | [vhost](https://github.com/expressjs/vhost) | +| `express.csrf` | [csurf](https://github.com/expressjs/csurf) | +| `express.directory` | [serve-index](https://github.com/expressjs/serve-index) | +| `express.static` | [serve-static](https://github.com/expressjs/serve-static) | Here is the [complete list](https://github.com/senchalabs/connect#middleware) of Express 4 middleware. @@ -305,78 +195,21 @@ middleware that is specific to the route. The following table lists other small but important changes in Express 4: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ObjectDescription
Node.jsExpress 4 requires Node.js 0.10.x or later and has dropped support for Node.js 0.8.x.
`http.createServer()` - The `http` module is no longer needed, unless you need to directly work with it - (socket.io/SPDY/HTTPS). The app can be started by using the `app.listen()` function. -
`app.configure()` - The `app.configure()` function has been removed. Use the `process.env.NODE_ENV` or - `app.get('env')` function to detect the environment and configure the app accordingly. -
`json spaces` - The `json spaces` application property is disabled by default in Express 4. -
`req.accepted()` - Use `req.accepts()`, `req.acceptsEncodings()`, `req.acceptsCharsets()`, and - `req.acceptsLanguages()`. -
`res.location()`No longer resolves relative URLs.
`req.params`Was an array; now an object.
`res.locals`Was a function; now an object.
`res.headerSent`Changed to `res.headersSent`.
`app.route`Now available as `app.mountpath`.
`res.on('header')`Removed.
`res.charset`Removed.
`res.setHeader('Set-Cookie', val)` - Functionality is now limited to setting the basic cookie value. Use `res.cookie()` for added - functionality. -
+| Object | Description | +| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Node.js | Express 4 requires Node.js 0.10.x or later and has dropped support for Node.js 0.8.x. | +| `http.createServer()` | The `http` module is no longer needed, unless you need to directly work with it (socket.io/SPDY/HTTPS). The app can be started by using the `app.listen()` function. | +| `app.configure()` | The `app.configure()` function has been removed. Use the `process.env.NODE_ENV` or `app.get('env')` function to detect the environment and configure the app accordingly. | +| `json spaces` | The `json spaces` application property is disabled by default in Express 4. | +| `req.accepted()` | Use `req.accepts()`, `req.acceptsEncodings()`, `req.acceptsCharsets()`, and `req.acceptsLanguages()`. | +| `res.location()` | No longer resolves relative URLs. | +| `req.params` | Was an array; now an object. | +| `res.locals` | Was a function; now an object. | +| `res.headerSent` | Changed to `res.headersSent`. | +| `app.route` | Now available as `app.mountpath`. | +| `res.on('header')` | Removed. | +| `res.charset` | Removed. | +| `res.setHeader('Set-Cookie', val)` | Functionality is now limited to setting the basic cookie value. Use `res.cookie()` for added functionality. | ## Example app migration