Developing an API using Node.js and MongoDB for the doctors of a Delhi Hospitals which have been allocated by the Govt for testing and caring for the Covid+ patients
- Clone/Download root folder on your machine
- Now, open up the cloned folder
- Fire up terminal, and follow these commands
npm install
node index.js
Goto localhost:8000 on any browser
- /doctor/register
- /doctor/login
- /pateint/register
- /patient/:id/createreport
- patient/:id/allreports
- report/:status
Well it's good to be sure that what you have been developed must be correct and in a state of usability.
Testing is the crucial part for a developer and hence it must for him to grasp knowledge over this topic too.
For testing we are using the mocha a javascript framework for testing the javascript app, Chai as a assertion library
Installing the testing libraries
```
npm i mocha chai chai-http
```
Make a directory name of test and all the files that you want to run on the test API
/doctor/register
:- Registers a new Doctor to the hospital Database with their credentials./doctor/login
:- Giving access to registered doctor to check the reports of their patients./patient/register
:- For registering a patient with a mobile number./patient/:id/createreport
:- API to create the reports of the registered patients./patient/:id/allreports
:- To get all the reports of the patient that request their reports./report/:status
:- To generate all the reports of the of patient
|__ HospitalApi
|
|__ config
| |__ mongooese.js
| |__ passportJWTstrategy.js
|__ controllers
| |__api
| |__v1
| |__ DoctorApi.js
| |__ PatientApi.js
| |__ ReportApi.js
|
|__ models
| |__ doctor.js
| |__ patient.js
| |__ report.js
|__ routes
| |__ index.js
| |__ api
| |__ index.js
| |__ v1
| |__ index.js
| |__ DoctorApi.js
| |__ PatientApi.js
| |__ ReportApi.js
|__ test
| |__ doctor.js
| |__ patient.js
|
|__ .gitignore
|__ index.js
|__ package-lock.json
|__ package.json
|__ README.md
Happy Hacking 😁