]> git.cworth.org Git - zombocom-ai/commitdiff
Use a single function for the tardis app
authorCarl Worth <cworth@cworth.org>
Wed, 21 Dec 2022 23:25:56 +0000 (15:25 -0800)
committerCarl Worth <cworth@cworth.org>
Wed, 21 Dec 2022 23:27:36 +0000 (15:27 -0800)
Whether or not there's a trailing slash on it.

index.js

index b149d09b58733ac1ab0b9da9fae802b2ff304446..04fe9bb0c65152eb1537d98a08e2315ca3430655 100644 (file)
--- 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) => {