diff --git a/packages/angular/src/generators/setup-ssr/__snapshots__/setup-ssr.spec.ts.snap b/packages/angular/src/generators/setup-ssr/__snapshots__/setup-ssr.spec.ts.snap index 654e6295bbe9ca..8170d0628afda8 100644 --- a/packages/angular/src/generators/setup-ssr/__snapshots__/setup-ssr.spec.ts.snap +++ b/packages/angular/src/generators/setup-ssr/__snapshots__/setup-ssr.spec.ts.snap @@ -143,14 +143,15 @@ export function app(): express.Express { // server.get('/api/**', (req, res) => { }); // Serve static files from /browser server.get( - '*.*', + '**', express.static(browserDistFolder, { maxAge: '1y', + index: 'index.html', }) ); // All regular routes use the Angular engine - server.get('*', (req, res, next) => { + server.get('**', (req, res, next) => { const { protocol, originalUrl, baseUrl, headers } = req; commonEngine @@ -262,14 +263,15 @@ export function app(): express.Express { // server.get('/api/**', (req, res) => { }); // Serve static files from /browser server.get( - '*.*', + '**', express.static(browserDistFolder, { maxAge: '1y', + index: 'index.html', }) ); // All regular routes use the Angular engine - server.get('*', (req, res, next) => { + server.get('**', (req, res, next) => { const { protocol, originalUrl, baseUrl, headers } = req; commonEngine @@ -354,12 +356,13 @@ export function app(): express.Express { // Example Express Rest API endpoints // server.get('/api/**', (req, res) => { }); // Serve static files from /browser - server.get('*.*', express.static(distFolder, { - maxAge: '1y' + server.get('**', express.static(distFolder, { + maxAge: '1y', + index: 'index.html' })); // All regular routes use the Angular engine - server.get('*', (req, res, next) => { + server.get('**', (req, res, next) => { const { protocol, originalUrl, baseUrl, headers } = req; commonEngine @@ -454,12 +457,13 @@ export function app(): express.Express { // Example Express Rest API endpoints // server.get('/api/**', (req, res) => { }); // Serve static files from /browser - server.get('*.*', express.static(distFolder, { - maxAge: '1y' + server.get('**', express.static(distFolder, { + maxAge: '1y', + index: 'index.html' })); // All regular routes use the Angular engine - server.get('*', (req, res, next) => { + server.get('**', (req, res, next) => { const { protocol, originalUrl, baseUrl, headers } = req; commonEngine diff --git a/packages/angular/src/generators/setup-ssr/files/server/application-builder/__serverFileName__ b/packages/angular/src/generators/setup-ssr/files/server/application-builder/__serverFileName__ index e0f5fa09694d6b..10460604ed2f3f 100644 --- a/packages/angular/src/generators/setup-ssr/files/server/application-builder/__serverFileName__ +++ b/packages/angular/src/generators/setup-ssr/files/server/application-builder/__serverFileName__ @@ -20,12 +20,13 @@ export function app(): express.Express { // Example Express Rest API endpoints // server.get('/api/**', (req, res) => { }); // Serve static files from /browser - server.get('*.*', express.static(browserDistFolder, { - maxAge: '1y' + server.get('**', express.static(browserDistFolder, { + maxAge: '1y', + index: 'index.html', })); // All regular routes use the Angular engine - server.get('*', (req, res, next) => { + server.get('**', (req, res, next) => { const { protocol, originalUrl, baseUrl, headers } = req; commonEngine diff --git a/packages/angular/src/generators/setup-ssr/files/server/server-builder/v17+/__serverFileName__ b/packages/angular/src/generators/setup-ssr/files/server/server-builder/v17+/__serverFileName__ index 5774e30795e480..082dc313e699e9 100644 --- a/packages/angular/src/generators/setup-ssr/files/server/server-builder/v17+/__serverFileName__ +++ b/packages/angular/src/generators/setup-ssr/files/server/server-builder/v17+/__serverFileName__ @@ -23,12 +23,13 @@ export function app(): express.Express { // Example Express Rest API endpoints // server.get('/api/**', (req, res) => { }); // Serve static files from /browser - server.get('*.*', express.static(distFolder, { - maxAge: '1y' + server.get('**', express.static(distFolder, { + maxAge: '1y', + index: 'index.html' })); // All regular routes use the Angular engine - server.get('*', (req, res, next) => { + server.get('**', (req, res, next) => { const { protocol, originalUrl, baseUrl, headers } = req; commonEngine