Moved maintenance page to public directory to be served by webserver.

This commit is contained in:
DebaucheryLibrarian
2023-12-07 01:27:44 +01:00
parent 214409a591
commit b872d7a0ec
4 changed files with 3 additions and 21 deletions

View File

@@ -162,19 +162,7 @@ async function initServer() {
});
router.use(errorHandler);
if (config.web.maintenance.enabled) {
app.use(express.static('public'));
app.get('/', (req, res) => {
res.status(503).render(path.join(__dirname, '../../assets/maintenance.ejs'), {
analytics: config.analytics,
text: config.web.maintenance.text,
});
});
} else {
app.use(router);
}
app.use(router);
const server = app.listen(config.web.port, config.web.host, () => {
const { address, port } = server.address();