-
Notifications
You must be signed in to change notification settings - Fork 1
/
backend.js
29 lines (24 loc) · 977 Bytes
/
backend.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
const express = require("express");
const cors = require("cors");
const appointmentRouter = require("./API-Modules/Controller-Routes/Appointment-Routes");
const clientRouter = require("./API-Modules/Controller-Routes/Client-Routes");
const dogRouter = require("./API-Modules/Controller-Routes/Dog-Routes");
const userRouter = require("./API-Modules/Controller-Routes/User-Routes");
const dotenv = require("dotenv");
dotenv.config();
const server = express();
const port = 5000;
server.use(cors());
server.use(express.json());
//GH actions test
//Get requests-------------------------------------------------------------------------------------------------------
server.get("/", (req, res) => {
res.redirect("/appointments");
});
server.use("/appointments", appointmentRouter);
server.use("/clients", clientRouter);
server.use("/dogs", dogRouter);
server.use("/users", userRouter);
server.listen(process.env.PORT || port, () => {
console.log(`Rest API Listening`);
});