-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
52 lines (39 loc) · 1.58 KB
/
server.js
File metadata and controls
52 lines (39 loc) · 1.58 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
const express = require('express');
const { isAPIExist } = require("./network");
//student
const studentGet = require('./http/get/student');
const studentPost = require('./http/post/student');
const studentPut = require('./http/put/student');
const studentDelete = require('./http/delete/student');
//instructor
const instructorGet = require('./http/get/instructor')
const instructorPost = require('./http/post/instructor')
const instructorPut = require('./http/put/instructor')
const instructorDelete = require('./http/delete/instructor')
//dance class
const danceClassGet = require('./http/get/dance_class')
const danceClassPost = require('./http/post/dance_class')
const danceClassPut = require('./http/put/danceclass');
//attendance
const attendanceGet = require('./http/get/attendance')
const attendancePost = require('./http/post/attendance')
//rating
const ratingPost = require('./http/post/rating')
//like
//attendance
const likeGet = require('./http/get/like')
const likePost = require('./http/post/like')
//notifs
const notificationGet = require('./http/get/notifications')
const app = express()
app.use(express.json())
app.use("/api/student",studentGet,studentPost,studentPut,studentDelete)
app.use('/api/instructor', instructorGet,instructorPost,instructorDelete,instructorPut)
app.use('/api/dance-class',danceClassGet, danceClassPost, danceClassPut)
app.use('/api/attendance', attendanceGet,attendancePost)
app.use('/api/rating', ratingPost)
app.use('/api/like', likeGet,likePost)
app.use('/api/notification', notificationGet)
app.listen(8000, ()=>{
console.log('Listening sa port 8000');
})