summaryrefslogtreecommitdiff
path: root/main.js
blob: 9ad63c77d2ec14c3aa6b5ce700728e06a32243bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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("/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}`));