summaryrefslogtreecommitdiff
path: root/main.js
diff options
context:
space:
mode:
authorJulien Dessaux2022-10-23 23:29:46 +0200
committerJulien Dessaux2022-10-23 23:29:46 +0200
commitcd33314d50986c5b143bf579d47f5ffdbe922e0f (patch)
tree1d90e2656f968a919dd4fa3f6063f0baf6ffb9f8 /main.js
parentBegan writing an express backend (diff)
downloadjeux-de-mots-cd33314d50986c5b143bf579d47f5ffdbe922e0f.tar.gz
jeux-de-mots-cd33314d50986c5b143bf579d47f5ffdbe922e0f.tar.bz2
jeux-de-mots-cd33314d50986c5b143bf579d47f5ffdbe922e0f.zip
Get started with ejs templating
Diffstat (limited to 'main.js')
-rw-r--r--main.js25
1 files changed, 23 insertions, 2 deletions
diff --git a/main.js b/main.js
index 17e47c2..b4b626b 100644
--- a/main.js
+++ b/main.js
@@ -5,11 +5,32 @@ export 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", {});
+ return res.render("index", {CWDATA: CWDATA});
});
app.use(express.static("static"));
const port = process.env.PORT || 3000;
-app.listen(port, () => console.log(`listening on port ${port}!`));
+app.listen(port, () => console.log(`listening on port ${port}`));