docs(aio): Upgrade server-side rendering example to Angular V6 (#23649)

PR Close #23649
This commit is contained in:
Brandon Roberts
2018-05-02 07:13:32 -05:00
committed by Igor Minar
parent b45fa5e263
commit 2cf6244b1d
13 changed files with 2000 additions and 226 deletions

View File

@ -17,7 +17,7 @@ const PORT = process.env.PORT || 4000;
const DIST_FOLDER = join(process.cwd(), 'dist');
// * NOTE :: leave this as require() since this file is built Dynamically from webpack
const { AppServerModuleNgFactory, LAZY_MODULE_MAP } = require('./dist/server/main.bundle');
const { AppServerModuleNgFactory, LAZY_MODULE_MAP } = require('./dist/server/main');
// Express Engine
import { ngExpressEngine } from '@nguniversal/express-engine';
@ -51,7 +51,7 @@ app.get('*.*', express.static(join(DIST_FOLDER, 'browser')));
// #docregion navigation-request
// All regular routes use the Universal engine
app.get('*', (req, res) => {
res.render(join(DIST_FOLDER, 'browser', 'index.html'), { req });
res.render('index', { req });
});
// #enddocregion navigation-request