diff options
-rw-r--r-- | draughts/routes/index.js | 16 |
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 |