summaryrefslogtreecommitdiff
path: root/main.js
diff options
context:
space:
mode:
authorJulien Dessaux2022-10-24 23:39:27 +0200
committerJulien Dessaux2022-10-24 23:39:27 +0200
commit62240e8370e6bc656a17eaef595275a92020a617 (patch)
treee83e4f83c46671457052f35aebc9463bc4fb61f0 /main.js
parentGet started with ejs templating (diff)
downloadjeux-de-mots-62240e8370e6bc656a17eaef595275a92020a617.tar.gz
jeux-de-mots-62240e8370e6bc656a17eaef595275a92020a617.tar.bz2
jeux-de-mots-62240e8370e6bc656a17eaef595275a92020a617.zip
Added favicon, split view in multiple parts
Diffstat (limited to '')
-rw-r--r--main.js30
1 files changed, 4 insertions, 26 deletions
diff --git a/main.js b/main.js
index b4b626b..2765c83 100644
--- a/main.js
+++ b/main.js
@@ -1,36 +1,14 @@
import express from "express";
-export const app = express();
+import playRouter from "./routes/play.js";
+
+const app = express();
app.set("views", "./views");
app.set("view engine", "ejs");
-let CWDATA = {
- board: [
- [ "", "", "", "", "","", "", "", "", "","", "", "", "", "" ],
- [ "", "", "", "", "","", "", "", "", "","", "", "", "", "" ],
- [ "", "", "", "", "","", "", "", "", "","", "", "", "", "" ],
- [ "", "", "", "", "","", "", "", "", "","", "", "", "", "" ],
- [ "", "", "", "", "","", "", "", "", "","", "", "", "", "" ],
- [ "", "", "", "", "","", "", "", "", "","", "", "", "", "" ],
- [ "", "", "", "", "","", "", "", "", "","", "", "", "", "" ],
- [ "", "", "", "", "","", "", "T", "E", "S","T", "", "", "", "" ],
- [ "", "", "", "", "","", "", "", "", "","", "", "", "", "" ],
- [ "", "", "", "", "","", "", "", "", "","", "", "", "", "" ],
- [ "", "", "", "", "","", "", "", "", "","", "", "", "", "" ],
- [ "", "", "", "", "","", "", "", "", "","", "", "", "", "" ],
- [ "", "", "", "", "","", "", "", "", "","", "", "", "", "" ],
- [ "", "", "", "", "","", "", "", "", "","", "", "", "", "" ],
- [ "", "", "", "", "","", "", "", "", "","", "", "", "", "" ]
- ],
- letters: [ "A", "B", "C", "D", "E", "F", "JOKER" ]
-};
-
-app.get("/", (req, res) => {
- return res.render("index", {CWDATA: CWDATA});
-});
-
app.use(express.static("static"));
+app.use("/play", playRouter);
const port = process.env.PORT || 3000;
app.listen(port, () => console.log(`listening on port ${port}`));