-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.js
35 lines (31 loc) · 1.15 KB
/
index.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
35
require("dotenv").config();
const express = require("express"),
cros = require("cors"),
bodyParser = require("body-parser"),
app = express(),
PORT = process.env.PORT || 8000;
const employeesRoutes = require("./routes/employees");
const adminsRoutes = require("./routes/admins");
const companyRoutes = require("./routes/company");
const jobsRoutes = require("./routes/jobs");
const applicationsRoutes = require("./routes/applications");
const reviewsRoutes = require("./routes/reviews");
const loginRoutes = require("./routes/login");
const paymentRoutes = require("./routes/payment");
app.use(cros());
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
//#region routes
app.use("/api/employees", employeesRoutes);
app.use("/api/admins", adminsRoutes);
app.use("/api/companies", companyRoutes);
app.use("/api/jobs", jobsRoutes);
app.use("/api/applications", applicationsRoutes);
app.use("/api/reviews", reviewsRoutes);
app.use("/api/login", loginRoutes);
app.use("/api/payment", paymentRoutes);
// #endregion
app.listen(PORT, () => {
console.log("Server is running on port 8000...");
console.log((URL = `http://localhost:${PORT}`));
});