-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
27 lines (22 loc) · 725 Bytes
/
index.js
File metadata and controls
27 lines (22 loc) · 725 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
27
const express = require("express");
const app = express();
const PORT = 5000;
// Import Routes
const parentRoutes = require("./API/Parent/parentRoutes.js");
const studentRoutes = require("./API/Student/studentRoutes.js");
const schoolRoutes = require("./API/School/schoolRoutes.js");
const teacherRoutes = require("./API/Teacher/teacherRoutes.js");
// Middleware to parse JSON
app.use(express.json());
// API Routes
app.use("/parent", parentRoutes);
app.use("/student", studentRoutes);
app.use("/school", schoolRoutes);
app.use("/teacher", teacherRoutes);
// Root Endpoint
app.get("/", async (req, res) => {
res.send("Welcome!");
});
app.listen(PORT, async () => {
console.log(`Server running on port ${PORT}`);
});