From 8c8e1691781eb0e41dd9d34b710168656d9ac56c Mon Sep 17 00:00:00 2001 From: D050513 Date: Thu, 25 Sep 2025 23:08:40 +0200 Subject: [PATCH 1/9] [cds^9.4] support for express 4 and 5 --- node.js/cds-facade.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/node.js/cds-facade.md b/node.js/cds-facade.md index 71366a97c3..3594554afb 100644 --- a/node.js/cds-facade.md +++ b/node.js/cds-facade.md @@ -301,12 +301,18 @@ cds.model = await cds.load('*') ### cds. app {.property} -The [express.js Application object](https://expressjs.com/de/4x/api.html#app) constructed during bootstrapping. Several framework operations use that to add express handlers or middlewares. It is initialised in built-in `server.js` like so: +The [express.js Application object](https://expressjs.com/en/api.html#app) constructed during bootstrapping. Several framework operations use that to add express handlers or middlewares. It is initialised in built-in `server.js` like so: ```js cds.app = require('express')() ``` +:::warning +The CAP Node.js runtime supports express.js versions 4 and 5. +However, some other (transitive) dependencies of your project may still rely on express.js version 4. +In this case, you must not upgrade. +::: + [Learn more about bootstrapping in `cds.server`.](./cds-serve){.learn-more} From 5a64a904edee6988cfdf21acc06e7042c2c82211 Mon Sep 17 00:00:00 2001 From: sjvans <30337871+sjvans@users.noreply.github.com> Date: Fri, 26 Sep 2025 01:37:39 +0200 Subject: [PATCH 2/9] Update node.js/cds-facade.md --- node.js/cds-facade.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node.js/cds-facade.md b/node.js/cds-facade.md index 3594554afb..c953f29eb0 100644 --- a/node.js/cds-facade.md +++ b/node.js/cds-facade.md @@ -308,7 +308,7 @@ cds.app = require('express')() ``` :::warning -The CAP Node.js runtime supports express.js versions 4 and 5. +The CAP Node.js runtime supports express.js versions 4 and 5 (beta). However, some other (transitive) dependencies of your project may still rely on express.js version 4. In this case, you must not upgrade. ::: From 37c15a8a3837b382ae40f98ecc49e345628ec8cd Mon Sep 17 00:00:00 2001 From: Mahati Shankar <93712176+smahati@users.noreply.github.com> Date: Tue, 7 Oct 2025 14:05:18 +0200 Subject: [PATCH 3/9] Update node.js/cds-facade.md --- node.js/cds-facade.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node.js/cds-facade.md b/node.js/cds-facade.md index c953f29eb0..a24b0d0b89 100644 --- a/node.js/cds-facade.md +++ b/node.js/cds-facade.md @@ -301,7 +301,7 @@ cds.model = await cds.load('*') ### cds. app {.property} -The [express.js Application object](https://expressjs.com/en/api.html#app) constructed during bootstrapping. Several framework operations use that to add express handlers or middlewares. It is initialised in built-in `server.js` like so: +The [express.js Application object](https://expressjs.com/en/api.html#app) is constructed during bootstrapping. Several framework operations use it to add express handlers or middlewares. It's initialized in the built-in `server.js` file: ```js cds.app = require('express')() From 483b5cb9c8e79620a6d79423de0a3fd75c44cb4d Mon Sep 17 00:00:00 2001 From: D050513 Date: Wed, 28 Jan 2026 10:42:41 +0100 Subject: [PATCH 4/9] latest + migration --- node.js/cds-facade.md | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/node.js/cds-facade.md b/node.js/cds-facade.md index 19991b913e..51a88b861b 100644 --- a/node.js/cds-facade.md +++ b/node.js/cds-facade.md @@ -307,12 +307,26 @@ The [express.js Application object](https://expressjs.com/en/api.html#app) is co cds.app = require('express')() ``` -:::warning -The CAP Node.js runtime supports express.js versions 4 and 5 (beta). -However, some other (transitive) dependencies of your project may still rely on express.js version 4. -In this case, you must not upgrade. +Starting from version 9.7.0, CAP Node.js supports version 5 of [`express`](https://expressjs.com/) in addition to version 4. + +In previous versions, `express` was a _bring your own_ dependency (modeled as an [_optional peer dependency_](https://docs.npmjs.com/cli/v11/configuring-npm/package-json#peerdependencies)), which meant you had to provide your own `express` dependency. +With `express^5` support, `express` became a standard dependency with an open range for both major versions 4 and 5 (i.e., `^4 || ^5`). + +If you don't require a specific version (for example, due to custom middleware), you can remove your own `express` dependency and automatically receive the latest version of `express` that is compatible with all your (transitive) dependencies. + +:::tip Check installed version of `express` +With CLI command `npm ls express`, you can check the installed version(s) of `express`. ::: +```bash +xtravels % npm ls express +@capire/xtravels@1.0.0 +└─┬ @sap/cds@9.7.0 + └── express@5.2.1 +``` + +For more information, check out the [`express`](https://expressjs.com/) [_Moving to Express 5_](https://expressjs.com/en/guide/migrating-5) migration guide and the [LTS Timeline](https://expressjs.com/2025/03/31/v5-1-latest-release.html). + [Learn more about bootstrapping in `cds.server`.](./cds-serve){.learn-more} @@ -345,7 +359,7 @@ cds.db = await cds.connect.to('db') ```ts function cds.error ( - status? : number + status? : number message : string | object, details? : object caller? : function From d7d023d56e0cf5af481efe36bd3c31881b8c497a Mon Sep 17 00:00:00 2001 From: Rene Jeglinsky Date: Wed, 28 Jan 2026 13:12:30 +0100 Subject: [PATCH 5/9] move code into tip and move sentence --- node.js/cds-facade.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/node.js/cds-facade.md b/node.js/cds-facade.md index 51a88b861b..47dc7afd62 100644 --- a/node.js/cds-facade.md +++ b/node.js/cds-facade.md @@ -309,14 +309,12 @@ cds.app = require('express')() Starting from version 9.7.0, CAP Node.js supports version 5 of [`express`](https://expressjs.com/) in addition to version 4. -In previous versions, `express` was a _bring your own_ dependency (modeled as an [_optional peer dependency_](https://docs.npmjs.com/cli/v11/configuring-npm/package-json#peerdependencies)), which meant you had to provide your own `express` dependency. With `express^5` support, `express` became a standard dependency with an open range for both major versions 4 and 5 (i.e., `^4 || ^5`). If you don't require a specific version (for example, due to custom middleware), you can remove your own `express` dependency and automatically receive the latest version of `express` that is compatible with all your (transitive) dependencies. :::tip Check installed version of `express` With CLI command `npm ls express`, you can check the installed version(s) of `express`. -::: ```bash xtravels % npm ls express @@ -324,6 +322,9 @@ xtravels % npm ls express └─┬ @sap/cds@9.7.0 └── express@5.2.1 ``` +::: + +In previous versions, `express` was a _bring your own_ dependency (modeled as an [_optional peer dependency_](https://docs.npmjs.com/cli/v11/configuring-npm/package-json#peerdependencies)), which meant you had to provide your own `express` dependency. For more information, check out the [`express`](https://expressjs.com/) [_Moving to Express 5_](https://expressjs.com/en/guide/migrating-5) migration guide and the [LTS Timeline](https://expressjs.com/2025/03/31/v5-1-latest-release.html). From c13dbfd8a269a630f4415e51dbe4f342de90496d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Jeglinsky?= Date: Wed, 28 Jan 2026 13:16:13 +0100 Subject: [PATCH 6/9] Apply suggestion from @renejeglinsky --- node.js/cds-facade.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/node.js/cds-facade.md b/node.js/cds-facade.md index 47dc7afd62..fac2ea61fe 100644 --- a/node.js/cds-facade.md +++ b/node.js/cds-facade.md @@ -307,9 +307,7 @@ The [express.js Application object](https://expressjs.com/en/api.html#app) is co cds.app = require('express')() ``` -Starting from version 9.7.0, CAP Node.js supports version 5 of [`express`](https://expressjs.com/) in addition to version 4. - -With `express^5` support, `express` became a standard dependency with an open range for both major versions 4 and 5 (i.e., `^4 || ^5`). +Starting from version 9.7.0, CAP Node.js supports version 5 of [`express`](https://expressjs.com/) in addition to version 4. With `express^5` support, `express` became a standard dependency with an open range for both major versions 4 and 5 (i.e., `^4 || ^5`). If you don't require a specific version (for example, due to custom middleware), you can remove your own `express` dependency and automatically receive the latest version of `express` that is compatible with all your (transitive) dependencies. From b579de1aabaf4d00f7c79a455958be7031e1e6c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Jeglinsky?= Date: Wed, 28 Jan 2026 13:34:38 +0100 Subject: [PATCH 7/9] Apply suggestions from code review Co-authored-by: sjvans <30337871+sjvans@users.noreply.github.com> --- node.js/cds-facade.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/node.js/cds-facade.md b/node.js/cds-facade.md index fac2ea61fe..ac09173334 100644 --- a/node.js/cds-facade.md +++ b/node.js/cds-facade.md @@ -307,8 +307,9 @@ The [express.js Application object](https://expressjs.com/en/api.html#app) is co cds.app = require('express')() ``` -Starting from version 9.7.0, CAP Node.js supports version 5 of [`express`](https://expressjs.com/) in addition to version 4. With `express^5` support, `express` became a standard dependency with an open range for both major versions 4 and 5 (i.e., `^4 || ^5`). +Starting from version 9.7.0, CAP Node.js supports version 5 of [`express`](https://expressjs.com/) in addition to version 4. +With `express^5` support, `express` became a standard dependency (instead of an [_optional peer dependency_](https://docs.npmjs.com/cli/v11/configuring-npm/package-json#peerdependencies)) with an open range for both major versions 4 and 5 (i.e., `^4 || ^5`). If you don't require a specific version (for example, due to custom middleware), you can remove your own `express` dependency and automatically receive the latest version of `express` that is compatible with all your (transitive) dependencies. :::tip Check installed version of `express` From a780d251c678d07ef88b4411e8425eec6f683fab Mon Sep 17 00:00:00 2001 From: Rene Jeglinsky Date: Wed, 28 Jan 2026 13:36:17 +0100 Subject: [PATCH 8/9] remove sentence as agreed --- node.js/cds-facade.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/node.js/cds-facade.md b/node.js/cds-facade.md index 47dc7afd62..00f11119e4 100644 --- a/node.js/cds-facade.md +++ b/node.js/cds-facade.md @@ -324,8 +324,6 @@ xtravels % npm ls express ``` ::: -In previous versions, `express` was a _bring your own_ dependency (modeled as an [_optional peer dependency_](https://docs.npmjs.com/cli/v11/configuring-npm/package-json#peerdependencies)), which meant you had to provide your own `express` dependency. - For more information, check out the [`express`](https://expressjs.com/) [_Moving to Express 5_](https://expressjs.com/en/guide/migrating-5) migration guide and the [LTS Timeline](https://expressjs.com/2025/03/31/v5-1-latest-release.html). [Learn more about bootstrapping in `cds.server`.](./cds-serve){.learn-more} From 24c80298b6f9217f1c0bfbe2a6f6720fb423307d Mon Sep 17 00:00:00 2001 From: Rene Jeglinsky Date: Wed, 28 Jan 2026 13:39:40 +0100 Subject: [PATCH 9/9] review --- node.js/cds-facade.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/node.js/cds-facade.md b/node.js/cds-facade.md index c7edd4b176..dc2b9b0951 100644 --- a/node.js/cds-facade.md +++ b/node.js/cds-facade.md @@ -301,7 +301,7 @@ cds.model = await cds.load('*') ### cds. app {.property} -The [express.js Application object](https://expressjs.com/en/api.html#app) is constructed during bootstrapping. Several framework operations use it to add express handlers or middlewares. It's initialized in the built-in `server.js` file: +Bootstrapping constructs the [express.js Application object](https://expressjs.com/en/api.html#app). Several framework operations use it to add express handlers or middlewares. The built-in `server.js` file initializes it: ```js cds.app = require('express')() @@ -309,11 +309,11 @@ cds.app = require('express')() Starting from version 9.7.0, CAP Node.js supports version 5 of [`express`](https://expressjs.com/) in addition to version 4. -With `express^5` support, `express` became a standard dependency (instead of an [_optional peer dependency_](https://docs.npmjs.com/cli/v11/configuring-npm/package-json#peerdependencies)) with an open range for both major versions 4 and 5 (i.e., `^4 || ^5`). +With `express^5` support, `express` became a standard dependency (instead of an [_optional peer dependency_](https://docs.npmjs.com/cli/v11/configuring-npm/package-json#peerdependencies)) with an open range for both major versions 4 and 5 (that is, `^4 || ^5`). If you don't require a specific version (for example, due to custom middleware), you can remove your own `express` dependency and automatically receive the latest version of `express` that is compatible with all your (transitive) dependencies. -:::tip Check installed version of `express` -With CLI command `npm ls express`, you can check the installed version(s) of `express`. +:::tip Verify installed version of `express` +With CLI command `npm ls express`, you can verify the installed version(s) of `express`. ```bash xtravels % npm ls express @@ -323,7 +323,7 @@ xtravels % npm ls express ``` ::: -For more information, check out the [`express`](https://expressjs.com/) [_Moving to Express 5_](https://expressjs.com/en/guide/migrating-5) migration guide and the [LTS Timeline](https://expressjs.com/2025/03/31/v5-1-latest-release.html). +For more information, refer to the [`express`](https://expressjs.com/) [_Moving to Express 5_](https://expressjs.com/en/guide/migrating-5) migration guide and the [LTS Timeline](https://expressjs.com/2025/03/31/v5-1-latest-release.html). [Learn more about bootstrapping in `cds.server`.](./cds-serve){.learn-more}