forked from DebaucheryLibrarian/traxxx
Moved maintenance page to public directory to be served by webserver.
This commit is contained in:
parent
214409a591
commit
b872d7a0ec
|
@ -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',
|
||||||
|
|
|
@ -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>
|
Before Width: | Height: | Size: 229 KiB After Width: | Height: | Size: 229 KiB |
|
@ -162,19 +162,7 @@ async function initServer() {
|
||||||
});
|
});
|
||||||
|
|
||||||
router.use(errorHandler);
|
router.use(errorHandler);
|
||||||
|
app.use(router);
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
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();
|
||||||
|
|
Loading…
Reference in New Issue