|
|
@@ -1,4 +1,5 @@
|
|
|
import express, { Express, NextFunction, Request, Response } from 'express';
|
|
|
+import path from 'path';
|
|
|
|
|
|
import { HttpStatusException } from '../../common/lib/http-status.exception';
|
|
|
import { Logger } from '../../common/util/logger.class';
|
|
|
@@ -17,6 +18,8 @@ export class Webserver {
|
|
|
|
|
|
this.app.use('/', express.static(process.env.STATIC_DIR || 'public'));
|
|
|
|
|
|
+ this.app.use('**', express.static(path.join(process.env.STATIC_DIR || 'public', 'index.html')));
|
|
|
+
|
|
|
this.app.use((err: any, req: Request, res: Response, next: NextFunction) => {
|
|
|
if (err instanceof HttpStatusException) {
|
|
|
res.status(err.statusCode).send(err.message);
|