-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.js
More file actions
26 lines (20 loc) · 687 Bytes
/
Copy pathapp.js
File metadata and controls
26 lines (20 loc) · 687 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
import express from "express";
import path from "path";
import cookieParser from "cookie-parser";
const app = express();
// SET TEMPLATE ENGINE AS EJS
app.set("view engine", "ejs");
// MIDDLEWARES
app.use(express.static(path.resolve("public")));
app.use(express.json({ limit: "16kb" }));
app.use(express.urlencoded({ extended: true, limit: "16kb" }));
app.use(cookieParser());
// ROUTES IMPORTS
import userRoutes from "./routes/users.routes.js";
import notesRoutes from "./routes/notes.routes.js";
import staticRoutes from "./routes/static.routes.js";
// ROUTES DECLARATION
app.use("/", staticRoutes);
app.use("/users", userRoutes);
app.use("/notes", notesRoutes);
export { app };