-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathrouter.js
More file actions
46 lines (29 loc) · 1.02 KB
/
router.js
File metadata and controls
46 lines (29 loc) · 1.02 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
const {Router} = require('express');
const router = Router();
const controller = require('./controllers/contollers');
router.get('/',(req,res) => {
res.status(200).send({text: 'all good'});
})
//DATABASE ROUTES
// get doctor appointments
router.get('/doctor/:id/appointments', controller.getDoctorAppointments);
// get patient appointments
router.get('/patient/:id/appointments', controller.getPatientAppointments)
// get a patient by id
router.get('/patient/:id', controller.getPatient)
// get a doctor by id
router.get('/doctor/:id', controller.getDoctor)
router.post('/login', controller.login);
router.post('/logout', controller.logout);
// get all doctors
router.get('/doctors', controller.getAllDoctors)
// create a patient
router.post('/patient', controller.addPatient)
// create a doctor
router.post('/doctor', controller.addDoctor)
// create a appointment
router.post('/appointment', controller.addAppointment)
// Signalling Server routes
router.post('/', controller.callHandshake)
// payments
module.exports = router;