forked from Ninety-Camera/web-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
25 lines (20 loc) · 811 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
//app.js
const express = require("express");
const app = express();
const bodyParser = require("body-parser");
const cors = require("cors");
const userController = require("./src/controllers/userController");
const cctvController = require("./src/controllers/cctvController");
const intrusionController = require("./src/controllers/intrusionController");
const cameraController = require("./src/controllers/cameraController");
app.use(cors({ origin: "*" }));
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
app.use("/api/user", userController);
app.use("/api/cctv", cctvController);
app.use("/api/intrusion", intrusionController);
app.use("/api/camera", cameraController);
app.get("/", (req, res) => {
res.status(200).send("Server is working");
});
module.exports = app;