-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
29 lines (23 loc) · 729 Bytes
/
index.js
File metadata and controls
29 lines (23 loc) · 729 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import express from "express";
import bodyParser from "body-parser";
import cookieParser from "cookie-parser";
import dotenv from "dotenv";
import authRoutes from "./routes/auth.js";
import todoRoutes from "./routes/todo.js";
import contentRoutes from "./routes/content.js";
dotenv.config();
const app = express();
app.use(express.static("public"));
app.set("view engine", "ejs");
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());
app.use(cookieParser());
// Auth Routes
app.use("/", authRoutes);
// Todo List Routes
app.use("/", todoRoutes);
app.use("/", contentRoutes);
const port = process.env.PORT;
app.listen(port, () => {
console.log(`Server running on http://localhost:${port}`);
});