Skip to content

Commit fe0fb66

Browse files
committed
refactor(@schematics/angular): update templates to use express version 5
1 parent 7a67752 commit fe0fb66

File tree

6 files changed

+242
-21
lines changed

6 files changed

+242
-21
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"@types/babel__core": "7.20.5",
7474
"@types/babel__generator": "^7.6.8",
7575
"@types/browser-sync": "^2.27.0",
76-
"@types/express": "^4.16.0",
76+
"@types/express": "~5.0.1",
7777
"@types/http-proxy": "^1.17.4",
7878
"@types/ini": "^4.0.0",
7979
"@types/jasmine": "~5.1.0",
@@ -106,7 +106,7 @@
106106
"eslint-config-prettier": "10.1.1",
107107
"eslint-plugin-header": "3.1.1",
108108
"eslint-plugin-import": "2.31.0",
109-
"express": "4.21.2",
109+
"express": "5.1.0",
110110
"fast-glob": "3.3.3",
111111
"globals": "16.0.0",
112112
"http-proxy": "^1.18.1",

packages/schematics/angular/ssr/files/application-builder/server.ts.template

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const angularApp = new AngularNodeAppEngine();
1818
*
1919
* Example:
2020
* ```ts
21-
* app.get('/api/**', (req, res) => {
21+
* app.get('/api/{*splat}', (req, res) => {
2222
* // Handle API request
2323
* });
2424
* ```
@@ -38,7 +38,7 @@ app.use(
3838
/**
3939
* Handle all other requests by rendering the Angular application.
4040
*/
41-
app.use('/**', (req, res, next) => {
41+
app.use((req, res, next) => {
4242
angularApp
4343
.handle(req)
4444
.then((response) =>

packages/schematics/angular/ssr/files/server-builder/server.ts.template

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ export function app(): express.Express {
2121
server.set('views', distFolder);
2222

2323
// Example Express Rest API endpoints
24-
// server.get('/api/**', (req, res) => { });
24+
// server.get('/api/{*splat}', (req, res) => { });
2525
// Serve static files from /browser
26-
server.get('*.*', express.static(distFolder, {
26+
server.get(express.static(distFolder, {
2727
maxAge: '1y'
2828
}));
2929

3030
// All regular routes use the Angular engine
31-
server.get('*', (req, res, next) => {
31+
server.use((req, res, next) => {
3232
const { protocol, originalUrl, baseUrl, headers } = req;
3333

3434
commonEngine

packages/schematics/angular/utility/latest-versions/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
"comment": "This file is needed so that dependencies are synced by Renovate.",
44
"private": true,
55
"dependencies": {
6-
"@types/express": "^4.17.17",
6+
"@types/express": "^5.0.1",
77
"@types/jasmine": "~5.1.0",
88
"@types/node": "^20.17.19",
99
"browser-sync": "^3.0.0",
10-
"express": "^4.18.2",
10+
"express": "^5.1.0",
1111
"jasmine-core": "~5.6.0",
1212
"jasmine-spec-reporter": "~7.0.0",
1313
"karma-chrome-launcher": "~3.2.0",

0 commit comments

Comments
 (0)