Skip to content

Commit

Permalink
feat(angular): update ssr server template (#22904)
Browse files Browse the repository at this point in the history
  • Loading branch information
leosvelperez committed May 10, 2024
1 parent 1ee1d3a commit 5e3b0f7
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5e3b0f7

Please sign in to comment.