We’re going to design an API for the doctors of a Hospital which has been allocated by the govt for testing and quarantine + well being of COVID-19 patients
.
├── config # Mongoose file (initializing Mongoose, passport-jwt-strategy)
├── controllers # Controller files (For Writing business logic)
├── models # Models files (for initilizing schema)
├── routes # Routes(route related files)
├── index.js
└── README.md
npm install
npm start
-> it ask username and password
POST /api/doctor/register
-> it ask username and password and responds with token
POST /api/doctor/login
-> it ask patients phone number
POST /api/patient/register
-> it ask patient_id in url params and status in request body.
POST /api/patient/:id/create_report
-> it ask patient_id in url params, it responds all the reports of patient from old to new.
GET /api/patient/:id/all_reports
-> it ask status in url params, it responds all the reports of multiple patients.
GET /api/reports/:status