diff --git a/ponyracer/package.json b/ponyracer/package.json index 3a70e1b..11b400a 100644 --- a/ponyracer/package.json +++ b/ponyracer/package.json @@ -18,17 +18,17 @@ "@angular/platform-browser": "^20.0.0-next.0", "@angular/platform-server": "^20.0.0-next.0", "@angular/router": "^20.0.0-next.0", - "@angular/ssr": "^20.0.0-next.3", - "express": "^4.18.2", + "@angular/ssr": "^20.0.0-next.4", + "express": "^5.1.0", "rxjs": "~7.8.0", "tslib": "^2.3.0", "zone.js": "~0.15.0" }, "devDependencies": { - "@angular/build": "^20.0.0-next.3", - "@angular/cli": "^20.0.0-next.3", + "@angular/build": "^20.0.0-next.4", + "@angular/cli": "^20.0.0-next.4", "@angular/compiler-cli": "^20.0.0-next.0", - "@types/express": "^4.17.17", + "@types/express": "^5.0.1", "@types/jasmine": "~5.1.0", "@types/node": "^20.17.19", "jasmine-core": "~5.6.0", diff --git a/ponyracer/src/server.ts b/ponyracer/src/server.ts index 54add3f..e6546c4 100644 --- a/ponyracer/src/server.ts +++ b/ponyracer/src/server.ts @@ -18,7 +18,7 @@ const angularApp = new AngularNodeAppEngine(); * * Example: * ```ts - * app.get('/api/**', (req, res) => { + * app.get('/api/{*splat}', (req, res) => { * // Handle API request * }); * ``` @@ -38,7 +38,7 @@ app.use( /** * Handle all other requests by rendering the Angular application. */ -app.use('/**', (req, res, next) => { +app.use((req, res, next) => { angularApp .handle(req) .then((response) => @@ -53,7 +53,11 @@ app.use('/**', (req, res, next) => { */ if (isMainModule(import.meta.url)) { const port = process.env['PORT'] || 4000; - app.listen(port, () => { + app.listen(port, (error) => { + if (error) { + throw error; + } + console.log(`Node Express server listening on http://localhost:${port}`); }); }