summaryrefslogtreecommitdiff
path: root/main.js
diff options
context:
space:
mode:
authorJulien Dessaux2022-10-27 23:56:29 +0200
committerJulien Dessaux2022-10-27 23:56:29 +0200
commit2611ded920a8345922346ed0d43e4efdd94401a1 (patch)
tree3313d976fbb11bdbfd1841ce336cc4372f9ab32c /main.js
parentAllow for placing the first word (diff)
downloadjeux-de-mots-2611ded920a8345922346ed0d43e4efdd94401a1.tar.gz
jeux-de-mots-2611ded920a8345922346ed0d43e4efdd94401a1.tar.bz2
jeux-de-mots-2611ded920a8345922346ed0d43e4efdd94401a1.zip
Began implementing middlewares, session and auth
Diffstat (limited to '')
-rw-r--r--main.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/main.js b/main.js
index 2765c83..9ad63c7 100644
--- a/main.js
+++ b/main.js
@@ -1,14 +1,20 @@
import express from "express";
+import helmet from "./middlewares/helmet.js";
+import loginRouter from "./routes/login.js";
import playRouter from "./routes/play.js";
+import rootRouter from "./routes/root.js";
const app = express();
+app.use(helmet);
app.set("views", "./views");
app.set("view engine", "ejs");
-app.use(express.static("static"));
+app.use("/login", loginRouter);
app.use("/play", playRouter);
+app.use("/static", express.static("static"));
+app.use("/", rootRouter);
const port = process.env.PORT || 3000;
app.listen(port, () => console.log(`listening on port ${port}`));