From 1e4934e341f9119dad52c27856e80645a1427470 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Wed, 21 Dec 2022 15:25:56 -0800 Subject: [PATCH] Use a single function for the tardis app Whether or not there's a trailing slash on it. --- index.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) 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) => { -- 2.43.0