@@ -48,7 +48,7 @@ import { hasNoValue, hasValue } from './src/app/shared/empty.util';
4848
4949import { UIServerConfig } from './src/config/ui-server-config.interface' ;
5050
51- import { ServerAppModule } from './src/main.server' ;
51+ import bootstrap from './src/main.server' ;
5252
5353import { buildAppConfig } from './src/config/config.server' ;
5454import { APP_CONFIG , AppConfig } from './src/config/app-config.interface' ;
@@ -130,7 +130,7 @@ export function app() {
130130 // Our Universal express-engine (found @ https://github.com/angular/universal/tree/master/modules/express-engine)
131131 server . engine ( 'html' , ( _ , options , callback ) =>
132132 ngExpressEngine ( {
133- bootstrap : ServerAppModule ,
133+ bootstrap,
134134 providers : [
135135 {
136136 provide : REQUEST ,
@@ -142,10 +142,10 @@ export function app() {
142142 } ,
143143 {
144144 provide : APP_CONFIG ,
145- useValue : environment
146- }
147- ]
148- } ) ( _ , ( options as any ) , callback )
145+ useValue : environment ,
146+ } ,
147+ ] ,
148+ } ) ( _ , ( options as any ) , callback ) ,
149149 ) ;
150150
151151 server . engine ( 'ejs' , ejs . renderFile ) ;
@@ -162,7 +162,7 @@ export function app() {
162162 server . get ( '/robots.txt' , ( req , res ) => {
163163 res . setHeader ( 'content-type' , 'text/plain' ) ;
164164 res . render ( 'assets/robots.txt.ejs' , {
165- 'origin' : req . protocol + '://' + req . headers . host
165+ 'origin' : req . protocol + '://' + req . headers . host ,
166166 } ) ;
167167 } ) ;
168168
@@ -177,7 +177,7 @@ export function app() {
177177 router . use ( '/sitemap**' , createProxyMiddleware ( {
178178 target : `${ environment . rest . baseUrl } /sitemaps` ,
179179 pathRewrite : path => path . replace ( environment . ui . nameSpace , '/' ) ,
180- changeOrigin : true
180+ changeOrigin : true ,
181181 } ) ) ;
182182
183183 /**
@@ -186,7 +186,7 @@ export function app() {
186186 router . use ( '/signposting**' , createProxyMiddleware ( {
187187 target : `${ environment . rest . baseUrl } ` ,
188188 pathRewrite : path => path . replace ( environment . ui . nameSpace , '/' ) ,
189- changeOrigin : true
189+ changeOrigin : true ,
190190 } ) ) ;
191191
192192 /**
@@ -197,7 +197,7 @@ export function app() {
197197 const RateLimit = require ( 'express-rate-limit' ) ;
198198 const limiter = new RateLimit ( {
199199 windowMs : ( environment . ui as UIServerConfig ) . rateLimiter . windowMs ,
200- max : ( environment . ui as UIServerConfig ) . rateLimiter . max
200+ max : ( environment . ui as UIServerConfig ) . rateLimiter . max ,
201201 } ) ;
202202 server . use ( limiter ) ;
203203 }
@@ -325,7 +325,7 @@ function initCache() {
325325 botCache = new LRU ( {
326326 max : environment . cache . serverSide . botCache . max ,
327327 ttl : environment . cache . serverSide . botCache . timeToLive ,
328- allowStale : environment . cache . serverSide . botCache . allowStale
328+ allowStale : environment . cache . serverSide . botCache . allowStale ,
329329 } ) ;
330330 }
331331
@@ -337,7 +337,7 @@ function initCache() {
337337 anonymousCache = new LRU ( {
338338 max : environment . cache . serverSide . anonymousCache . max ,
339339 ttl : environment . cache . serverSide . anonymousCache . timeToLive ,
340- allowStale : environment . cache . serverSide . anonymousCache . allowStale
340+ allowStale : environment . cache . serverSide . anonymousCache . allowStale ,
341341 } ) ;
342342 }
343343}
@@ -415,7 +415,7 @@ function checkCacheForRequest(cacheName: string, cache: LRU<string, any>, req, r
415415 const key = getCacheKey ( req ) ;
416416
417417 // Check if this page is in our cache
418- let cachedCopy = cache . get ( key ) ;
418+ const cachedCopy = cache . get ( key ) ;
419419 if ( cachedCopy ) {
420420 if ( environment . cache . serverSide . debug ) { console . log ( `CACHE HIT FOR ${ key } in ${ cacheName } cache` ) ; }
421421
@@ -529,20 +529,20 @@ function serverStarted() {
529529function createHttpsServer ( keys ) {
530530 const listener = createServer ( {
531531 key : keys . serviceKey ,
532- cert : keys . certificate
532+ cert : keys . certificate ,
533533 } , app ) . listen ( environment . ui . port , environment . ui . host , ( ) => {
534534 serverStarted ( ) ;
535535 } ) ;
536536
537537 // Graceful shutdown when signalled
538- const terminator = createHttpTerminator ( { server : listener } ) ;
538+ const terminator = createHttpTerminator ( { server : listener } ) ;
539539 process . on ( 'SIGINT' , ( ) => {
540- void ( async ( ) => {
541- console . debug ( 'Closing HTTPS server on signal' ) ;
542- await terminator . terminate ( ) . catch ( e => { console . error ( e ) ; } ) ;
543- console . debug ( 'HTTPS server closed' ) ;
544- } ) ( ) ;
545- } ) ;
540+ void ( async ( ) => {
541+ console . debug ( 'Closing HTTPS server on signal' ) ;
542+ await terminator . terminate ( ) . catch ( e => { console . error ( e ) ; } ) ;
543+ console . debug ( 'HTTPS server closed' ) ;
544+ } ) ( ) ;
545+ } ) ;
546546}
547547
548548/**
@@ -559,14 +559,14 @@ function run() {
559559 } ) ;
560560
561561 // Graceful shutdown when signalled
562- const terminator = createHttpTerminator ( { server : listener } ) ;
562+ const terminator = createHttpTerminator ( { server : listener } ) ;
563563 process . on ( 'SIGINT' , ( ) => {
564- void ( async ( ) => {
565- console . debug ( 'Closing HTTP server on signal' ) ;
566- await terminator . terminate ( ) . catch ( e => { console . error ( e ) ; } ) ;
567- console . debug ( 'HTTP server closed.' ) ; return undefined ;
568- } ) ( ) ;
569- } ) ;
564+ void ( async ( ) => {
565+ console . debug ( 'Closing HTTP server on signal' ) ;
566+ await terminator . terminate ( ) . catch ( e => { console . error ( e ) ; } ) ;
567+ console . debug ( 'HTTP server closed.' ) ; return undefined ;
568+ } ) ( ) ;
569+ } ) ;
570570}
571571
572572function start ( ) {
@@ -597,7 +597,7 @@ function start() {
597597 if ( serviceKey && certificate ) {
598598 createHttpsServer ( {
599599 serviceKey : serviceKey ,
600- certificate : certificate
600+ certificate : certificate ,
601601 } ) ;
602602 } else {
603603 console . warn ( 'Disabling certificate validation and proceeding with a self-signed certificate. If this is a production server, it is recommended that you configure a valid certificate instead.' ) ;
@@ -606,7 +606,7 @@ function start() {
606606
607607 createCertificate ( {
608608 days : 1 ,
609- selfSigned : true
609+ selfSigned : true ,
610610 } , ( error , keys ) => {
611611 createHttpsServer ( keys ) ;
612612 } ) ;
@@ -627,7 +627,7 @@ function healthCheck(req, res) {
627627 } )
628628 . catch ( ( error ) => {
629629 res . status ( error . response . status ) . send ( {
630- error : error . message
630+ error : error . message ,
631631 } ) ;
632632 } ) ;
633633}
0 commit comments