From 85148ea5fa092f2bcf2dff2dc985eb1c2c8c2a0c Mon Sep 17 00:00:00 2001 From: Matt Walsh Date: Tue, 20 Oct 2020 16:33:44 +0000 Subject: [PATCH] fix relative path in express server --- index.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/index.js b/index.js index b7212e1..c0e40cb 100644 --- a/index.js +++ b/index.js @@ -26,20 +26,13 @@ const index = (req, res) => { 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); -app.get('/twc3.html', twc3); // fallback -app.get('*', express.static('./server')); +app.get('*', express.static(path.join(__dirname, './server'))); const server = app.listen(port, () => { console.log(`Server listening on port ${port}`);