From 8eb13e7ca7350418535eb7a163aeccd73bbf8a1e Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sun, 9 Jan 2022 23:34:36 +0100 Subject: Remove semicolons They are optional in javascript, so why waste screen space on them? --- draughts/routes/index.js | 16 +++++----------- 1 file 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 -- cgit v1.2.3