Browse Source

WEB UI microservice: fallback to index.html for non-existent resource.

pull/11641/head
Igor Kulikov 2 years ago
parent
commit
9eee7634c4
  1. 7
      msa/web-ui/server.ts

7
msa/web-ui/server.ts

@ -99,7 +99,12 @@ let connections: Socket[] = [];
const root = path.join(webDir, 'public');
app.use(express.static(root));
const staticServe = express.static(root);
app.use(staticServe);
app.use((req, res, next) => {
res.sendFile(path.join(root, 'index.html'));
});
server.listen(bindPort, bindAddress, () => {
logger.info('==> 🌎 Listening on port %s.', bindPort);

Loading…
Cancel
Save