@@ -2,7 +2,7 @@ import 'zone.js/node';
22
33import { APP_BASE_HREF } from '@angular/common' ;
44import { CommonEngine } from '@angular/ssr/node' ;
5- import * as express from 'express' ;
5+ import express from 'express' ;
66import { existsSync } from 'node:fs' ;
77import { join } from 'node:path' ;
88import AppServerModule from './src/main.server' ;
@@ -23,9 +23,12 @@ export function app(): express.Express {
2323 // Example Express Rest API endpoints
2424 // server.get('/api/**', (req, res) => { });
2525 // Serve static files from /browser
26- server . get ( '*.*' , express . static ( distFolder , {
27- maxAge : '1y'
28- } ) ) ;
26+ server . get (
27+ '*.*' ,
28+ express . static ( distFolder , {
29+ maxAge : '1y'
30+ } )
31+ ) ;
2932
3033 // All regular routes use the Angular engine
3134 server . get ( '*' , ( req , res , next ) => {
@@ -37,7 +40,7 @@ export function app(): express.Express {
3740 documentFilePath : indexHtml ,
3841 url : `${ protocol } ://${ headers . host } ${ originalUrl } ` ,
3942 publicPath : distFolder ,
40- providers : [ { provide : APP_BASE_HREF , useValue : baseUrl } ] ,
43+ providers : [ { provide : APP_BASE_HREF , useValue : baseUrl } ]
4144 } )
4245 . then ( ( html ) => res . send ( html ) )
4346 . catch ( ( err ) => next ( err ) ) ;
@@ -61,7 +64,7 @@ function run(): void {
6164// The below code is to ensure that the server is run only when not requiring the bundle.
6265declare const __non_webpack_require__ : NodeRequire ;
6366const mainModule = __non_webpack_require__ . main ;
64- const moduleFilename = mainModule && mainModule . filename || '' ;
67+ const moduleFilename = ( mainModule && mainModule . filename ) || '' ;
6568if ( moduleFilename === __filename || moduleFilename . includes ( 'iisnode' ) ) {
6669 run ( ) ;
6770}
0 commit comments