Skip to content

Latest commit

 

History

History
72 lines (42 loc) · 2.13 KB

README.md

File metadata and controls

72 lines (42 loc) · 2.13 KB

Hospital-server

💫 CRUD on Hospital data JSON file using Core modules from Node JS and Express

The requirement is as follows 📝

  • Set up Hospital Data in JSON file with following information: Name of the hospital, Patient Count and Hospital location
  • Perform CRUD(GET,POST,PUT,DELETE) operations on the dataset
  • Use the core modules available in NodeJS to read,write to the JSON file.

GET request - Read list of all hospitals

➡️ GET http://localhost:3000/api/hospitals

POSTMAN results: GET Request

GET request - Read a single hospital

➡️ GET http://localhost:3000/api/hospitals/:id

POSTMAN result:

GET Request anyone hospital

POST request - Create a new Hospital

➡️ POST http://localhost:3000/api/hospitals

POSTMAN result:

POST Request

PUT request - Update an existing Hospital

➡️ PUT http://localhost:3000/api/hospitals/:id

POSTMAN result:

Before PUT request is sent

Before PUT request is send

After PUT request is sent

After PUT request is send


DELETE request - Delete an existing hospital

➡️ DELETE http://localhost:3000/api/hospitals/:id

POSTMAN result:

Before DELETE request is sent

Before Sending the DELETE Request

After DELETE request is sent

DELETE Request