fix relative path in express server

This commit is contained in:
Matt Walsh 2020-10-20 16:33:44 +00:00
parent 5ace925557
commit 85148ea5fa

View file

@ -26,20 +26,13 @@ const index = (req, res) => {
version, version,
}); });
}; };
const twc3 = (req, res) => {
res.render(path.join(__dirname, 'views/twc3'), {
production: false,
version,
});
};
// two html pages // main page
app.get('/index.html', index); app.get('/index.html', index);
app.get('/', index); app.get('/', index);
app.get('/twc3.html', twc3);
// fallback // fallback
app.get('*', express.static('./server')); app.get('*', express.static(path.join(__dirname, './server')));
const server = app.listen(port, () => { const server = app.listen(port, () => {
console.log(`Server listening on port ${port}`); console.log(`Server listening on port ${port}`);