From 9c464327fa0c026d638efa82af03710b5b6973b1 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Sat, 22 Oct 2022 18:38:28 +0200 Subject: Began writing an express backend --- main.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 main.js (limited to 'main.js') diff --git a/main.js b/main.js new file mode 100644 index 0000000..17e47c2 --- /dev/null +++ b/main.js @@ -0,0 +1,15 @@ +import express from "express"; + +export const app = express(); + +app.set("views", "./views"); +app.set("view engine", "ejs"); + +app.get("/", (req, res) => { + return res.render("index", {}); +}); + +app.use(express.static("static")); + +const port = process.env.PORT || 3000; +app.listen(port, () => console.log(`listening on port ${port}!`)); -- cgit v1.2.3