aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Voss <thomasvoss@live.com> 2022-01-09 23:34:36 +0100
committerThomas Voss <thomasvoss@live.com> 2022-01-09 23:34:36 +0100
commit8eb13e7ca7350418535eb7a163aeccd73bbf8a1e (patch)
treed191ba5cdbe1836b278e594f44ba76bdaf9fb96d
parent3dc9f6d09da4eafc989e2775254315064c603d79 (diff)
Remove semicolons
They are optional in javascript, so why waste screen space on them?
-rw-r--r--draughts/routes/index.js16
1 files changed, 5 insertions, 11 deletions
diff --git a/draughts/routes/index.js b/draughts/routes/index.js
index ca11c17..6a8e9ff 100644
--- a/draughts/routes/index.js
+++ b/draughts/routes/index.js
@@ -1,14 +1,8 @@
-const express = require("express");
-const router = express.Router();
+const router = require("express").Router()
+const root = "./public"
/* GET home page */
-router.get("/", (req, res) => {
- res.sendFile("splash.html", { root: "./public" });
-});
+router.get("/", (_, res) => res.sendFile("splash.html", { root: root }))
+router.get("/play", (_, res) => res.sendFile("game.html", { root: root }))
-/* Pressing the 'PLAY' button, returns this page */
-router.get("/play", (req, res) => {
- res.sendFile("game.html", { root: "./public" });
-});
-
-module.exports = router;
+module.exports = router