-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
38 lines (30 loc) · 1.01 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
36
37
38
//importing dependencies
const Express = require("express");
//importing the routes and configs
const DBConnection = require("./configs/DatabaseConnection");
const LoginUser = require("./routes/LoginUser");
const RegisterUser = require("./routes/RegisterUser");
const AdminUsersEndpoint = require("./routes/AdminUsersEndpoint");
const allEvent = require("./routes/EventCards");
const ClubEvents = require("./routes/CardClubView");
const app = Express();
app.use(Express.json());
//connecting to the database
DBConnection();
//routes
app.use("/api/login", LoginUser);
app.use("/api/register", RegisterUser);
app.use("/api/all-events", allEvent);
app.use("/api/admin-users-portal", AdminUsersEndpoint);
app.use("/api/club-events", ClubEvents);
//Homepage Endpoint
app.get("/", (request, response) => {
response.send("Welcome to the AmritaEvents Api HomePage");
});
const PORT = process.env.PORT || 3000;
//listening
app.listen(PORT, () => {
console.log(`Listening on port ${PORT}`);
});
// this comment never existed.
//right