From: Carl Worth Date: Wed, 21 Dec 2022 23:25:56 +0000 (-0800) Subject: Use a single function for the tardis app X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=1e4934e341f9119dad52c27856e80645a1427470;hp=affd7ecf524e51786710a87d6056f7f0a3e6d0b1;p=zombocom-ai Use a single function for the tardis app Whether or not there's a trailing slash on it. --- diff --git a/index.js b/index.js index b149d09..04fe9bb 100644 --- a/index.js +++ b/index.js @@ -121,17 +121,12 @@ app.get('/index.html', (req, res) => { res.sendFile(__dirname + '/index.html'); }); -app.get('/tardis', (req, res) => { +function tardis_app(req, res) { res.sendFile(__dirname + '/tardis.html'); -}); - -app.get('/tardis/', (req, res) => { - res.sendFile(__dirname + '/tardis.html'); -}); +} -app.get('/tardis/index.html', (req, res) => { - res.sendFile(__dirname + '/tardis.html'); -}); +app.get('/tardis', tardis_app); +app.get('/tardis/', tardis_app); io.on('connection', (socket) => {