checkpoint

This commit is contained in:
peter
2020-03-08 14:16:06 +01:00
parent c4ca96fef9
commit b2707bb88f
22 changed files with 5904 additions and 509 deletions
+22
View File
@@ -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
*/