function ngExpressEngine(setupOptions) {
        var engine$1 = new engine.CommonEngine(setupOptions.bootstrap, setupOptions.providers);
        return function (filePath, options, callback) {
            var _a, _b, _c, _d;
            try {
                var renderOptions = Object.assign({}, options);
                if (!setupOptions.bootstrap && !renderOptions.bootstrap) {
                    throw new Error('You must pass in a NgModule or NgModuleFactory to be bootstrapped');
                }
                var req = renderOptions.req;
                var res = renderOptions.res || req.res;
                renderOptions.url =
                    renderOptions.url || req.protocol + "://" + (req.get('host') || '') + req.originalUrl;
                renderOptions.documentFilePath = renderOptions.documentFilePath || filePath;
                renderOptions.providers = __spreadArray(__spreadArray([], __read((renderOptions.providers || []))), [getReqResProviders(req, res)]);
                (renderOptions.publicPath =
                    (_b = (_a = renderOptions.publicPath) !== null && _a !== void 0 ? _a : setupOptions.publicPath) !== null && _b !== void 0 ? _b : (_c = options.settings) === null || _c === void 0 ? void 0 : _c.views),
                    (renderOptions.inlineCriticalCss =
                        (_d = renderOptions.inlineCriticalCss) !== null && _d !== void 0 ? _d : setupOptions.inlineCriticalCss);
                engine$1
                    .render(renderOptions)
                    .then(function (html) { return callback(null, html); })
                    .catch(callback);
            }
            catch (err) {
                callback(err);
            }
        };
    }
/**
     * This is an express engine for handling Angular Applications
     */
This is an express engine for handling Angular Applications
This is an express engine for handling Angular Applications
function ngExpressEngine(setupOptions) {
        var engine$1 = new engine.CommonEngine(setupOptions.bootstrap, setupOptions.providers);
        return function (filePath, options, callback) {
            var _a, _b, _c, _d;
            try {
                var renderOptions = Object.assign({}, options);
                if (!setupOptions.bootstrap && !renderOptions.bootstrap) {
                    throw new Error('You must pass in a NgModule or NgModuleFactory to be bootstrapped');
                }
                var req = renderOptions.req;
                var res = renderOptions.res || req.res;
                renderOptions.url =
                    renderOptions.url || req.protocol + "://" + (req.get('host') || '') + req.originalUrl;
                renderOptions.documentFilePath = renderOptions.documentFilePath || filePath;
                renderOptions.providers = __spreadArray(__spreadArray([], __read((renderOptions.providers || []))), [getReqResProviders(req, res)]);
                (renderOptions.publicPath =
                    (_b = (_a = renderOptions.publicPath) !== null && _a !== void 0 ? _a : setupOptions.publicPath) !== null && _b !== void 0 ? _b : (_c = options.settings) === null || _c === void 0 ? void 0 : _c.views),
                    (renderOptions.inlineCriticalCss =
                        (_d = renderOptions.inlineCriticalCss) !== null && _d !== void 0 ? _d : setupOptions.inlineCriticalCss);
                engine$1
                    .render(renderOptions)
                    .then(function (html) { return callback(null, html); })
                    .catch(callback);
            }
            catch (err) {
                callback(err);
            }
        };
    }
function ngExpressEngine ( setupOptions ) { var engine$1 = new engine . CommonEngine ( setupOptions . bootstrap , setupOptions . providers ) ; return function ( filePath , options , callback ) { var _a , _b , _c , _d ; try { var renderOptions = Object . assign ( { } , options ) ; if ( ! setupOptions . bootstrap && ! renderOptions . bootstrap ) { throw new Error ( 'You must pass in a NgModule or NgModuleFactory to be bootstrapped' ) ; } var req = renderOptions . req ; var res = renderOptions . res || req . res ; renderOptions . url = renderOptions . url || req . protocol + "://" + ( req . get ( 'host' ) || '' ) + req . originalUrl ; renderOptions . documentFilePath = renderOptions . documentFilePath || filePath ; renderOptions . providers = __spreadArray ( __spreadArray ( [ ] , __read ( ( renderOptions . providers || [ ] ) ) ) , [ getReqResProviders ( req , res ) ] ) ; ( renderOptions . publicPath = ( _b = ( _a = renderOptions . publicPath ) !== null && _a !== void 0 ? _a : setupOptions . publicPath ) !== null && _b !== void 0 ? _b : ( _c = options . settings ) === null || _c === void 0 ? void 0 : _c . views ) , ( renderOptions . inlineCriticalCss = ( _d = renderOptions . inlineCriticalCss ) !== null && _d !== void 0 ? _d : setupOptions . inlineCriticalCss ) ; engine$1 . render ( renderOptions ) . then ( function ( html ) { return callback ( null , html ) ; } ) . catch ( callback ) ; } catch ( err ) { callback ( err ) ; } } ; }
This is an express engine for handling Angular Applications
This is an express engine for handling Angular Applications