From cd33314d50986c5b143bf579d47f5ffdbe922e0f Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Sun, 23 Oct 2022 23:29:46 +0200 Subject: Get started with ejs templating --- main.js | 25 +++++++++++++++++++++++-- views/index.ejs | 23 +---------------------- 2 files changed, 24 insertions(+), 24 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}`)); diff --git a/views/index.ejs b/views/index.ejs index f3784a2..4e691f7 100644 --- a/views/index.ejs +++ b/views/index.ejs @@ -42,27 +42,6 @@

- + -- cgit v1.2.3