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

@ -36,10 +36,6 @@ module.exports = {
maxAge: 2629800000, // 1 month maxAge: 2629800000, // 1 month
}, },
}, },
maintenance: {
enabled: false,
text: 'Traxxx is currently under maintenance. We will be back shortly!',
},
}, },
redis: { redis: {
host: 'localhost', host: 'localhost',

View File

@ -32,7 +32,7 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
font-family: sans-serif; font-family: sans-serif;
background: url('/img/maintenance_ella_reese.jpeg'); background: url('/maintenance_ella_reese.jpeg');
background-position: top center; background-position: top center;
background-size: cover background-size: cover
} }
@ -52,8 +52,6 @@
</head> </head>
<body> <body>
<div class="text"> <div class="text">Traxxx is currently under maintenance. We will be back shortly!</div>
<%= text %>
</div>
</body> </body>
</html> </html>

View File

Before

Width:  |  Height:  |  Size: 229 KiB

After

Width:  |  Height:  |  Size: 229 KiB

View File

@ -162,19 +162,7 @@ async function initServer() {
}); });
router.use(errorHandler); 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 server = app.listen(config.web.port, config.web.host, () => {
const { address, port } = server.address(); const { address, port } = server.address();