-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
34 lines (27 loc) · 923 Bytes
/
app.js
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
30
31
32
33
34
const express = require("express");
const morgan = require("morgan");
const cookieParser = require("cookie-parser");
//Import all routes
const home = require("./routes/home");
const user = require("./routes/user");
const project = require("./routes/project");
const workexperience = require("./routes/workexperience");
const education = require("./routes/education");
const about = require("./routes/about");
const testimonial = require("./routes/testimonial");
require("dotenv").config();
const app = express();
// regular middleware
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
// cookies and middlewares
app.use(cookieParser());
app.use(morgan("tiny"));
app.use("/api/v1", home);
app.use("/api/v1", user);
app.use("/api/v1", project);
app.use("/api/v1", workexperience);
app.use("/api/v1", education);
app.use("/api/v1", about);
app.use("/api/v1", testimonial);
module.exports = app;