checkpoint
This commit is contained in:
@@ -22,6 +22,10 @@ import { Injector } from '../Injector/Injector';
|
||||
import { Shoutbox } from '../Components/Shoutbox/Shoutbox';
|
||||
import { PubSub } from '../Components/PubSub/PubSub';
|
||||
|
||||
import { ngExpressEngine } from '@nguniversal/express-engine';
|
||||
import { APP_BASE_HREF } from '@angular/common';
|
||||
import { AppServerModule } from './app.server.module';
|
||||
|
||||
|
||||
const logger = getLogger("admin", 'debug')
|
||||
|
||||
@@ -132,6 +136,24 @@ implements TableDefinitionExporter, IAdmin {
|
||||
this.express = express()
|
||||
this.express.use('/', express.static('static'))
|
||||
|
||||
|
||||
this.express.engine('html', ngExpressEngine({
|
||||
bootstrap: AppServerModule,
|
||||
}));
|
||||
|
||||
this.express.set('view engine', 'html');
|
||||
this.express.set('views', 'static');
|
||||
|
||||
// Serve static files from /browser
|
||||
this.express.get('*.*', express.static('static', {
|
||||
maxAge: '1y'
|
||||
}));
|
||||
|
||||
// All regular routes use the Universal engine
|
||||
this.express.get('*', (req, res) => {
|
||||
res.render('index', { req, providers: [{ provide: APP_BASE_HREF, useValue: req.baseUrl }] });
|
||||
});
|
||||
|
||||
/**
|
||||
* get the compiled FrontendPlugins.js
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user