File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 113113 "date-fns" : " ^2.29.3" ,
114114 "date-fns-tz" : " ^1.3.7" ,
115115 "deepmerge" : " ^4.3.1" ,
116+ "domino" : " ^2.1.6" ,
116117 "ejs" : " ^3.1.9" ,
117118 "express" : " ^4.18.2" ,
118119 "express-rate-limit" : " ^5.1.3" ,
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import * as express from 'express';
2525import * as ejs from 'ejs' ;
2626import * as compression from 'compression' ;
2727import * as expressStaticGzip from 'express-static-gzip' ;
28+ import * as domino from 'domino' ;
2829/* eslint-enable import/no-namespace */
2930import axios from 'axios' ;
3031import LRU from 'lru-cache' ;
@@ -79,6 +80,14 @@ let anonymousCache: LRU<string, any>;
7980// extend environment with app config for server
8081extendEnvironmentWithAppConfig ( environment , appConfig ) ;
8182
83+ // Create a DOM window object based on the template
84+ const _window = domino . createWindow ( indexHtml ) ;
85+
86+ // Assign the DOM window and document objects to the global object
87+ ( global as any ) . window = _window ;
88+ ( global as any ) . document = _window . document ;
89+ ( global as any ) . navigator = _window . navigator ;
90+
8291// The Express app is exported so that it can be used by serverless Functions.
8392export function app ( ) {
8493
Original file line number Diff line number Diff line change @@ -5305,7 +5305,7 @@ domhandler@^5.0.2, domhandler@^5.0.3:
53055305 dependencies:
53065306 domelementtype "^2.3.0"
53075307
5308- domino@^2.1.2:
5308+ domino@^2.1.2, domino@^2.1.6 :
53095309 version "2.1.6"
53105310 resolved "https://registry.yarnpkg.com/domino/-/domino-2.1.6.tgz#fe4ace4310526e5e7b9d12c7de01b7f485a57ffe"
53115311 integrity sha512-3VdM/SXBZX2omc9JF9nOPCtDaYQ67BGp5CoLpIQlO2KCAPETs8TcDHacF26jXadGbvUteZzRTeos2fhID5+ucQ==
You can’t perform that action at this time.
0 commit comments