Repository files navigation
Step #1 -once I have set up all of the folders in Visual Studio Code, I open a new terminal window
and type npm initialize (node package manger- this creates the "package.json" file)
Step #2 -in the terminal window I type "npm install express"
then "Set-ExecutionPolicy unresticted"
Step #3 - the app on line 3 I have entered into code will handle the API requests
Step #4 - Here I am testing the API code I have so far
Step #5 - I tested to see that the http mesage loads in a browser:
Step #6 -I added app.get, app.post, app.put, and app.delete in my code and then tested each function in Postman:
Step #7 -testing the Get function in Postman:
Step #8 -testing the Post function in Postman:
Step #9 -testing the Put function in Postman:
Step #10 -testing the Delete function in Postman:
Step #11 -I added two new patients and records for each of them:
Step #12 -When I send the request to the API, I want to be able to
validate the person to make sure they exist ( that their SSN# matches
and that the appropriate record is returned. The header of the
HTTP request is used to send the authentication data
Step #13 -I request the medical records in the body:
... the medical records request printed in the Terminal:
Step #14 -I request the medical records in the body:
Step #15 -I entered code for VS Code to generate a "Status Code 404 error#
if the wrong SSN# is entered:
... I enter an INVALID SSN# in Postman to test:
... Postman generates Status Code- '404 Not Found :
Step #16 -Code created in Visual Studio that will generate errors if
if the first and lat names are correct but ssn# is incorrectly entered:
... error "401 Unauthorized is generated "first/Last name didn't match SSN":
Step #17 - if the patient requests his records they will dislay:
... error "501 will display if the records are improperly requested":
Step #18 - creating a new patient in Postman:
... code for the new patient and it prints in the terminal:
Step #19 - Using the Put method: I update existing Patient phone number:
... error - Patient not found:
About
A Simple REST API that I built
Resources
Stars
Watchers
Forks
You can’t perform that action at this time.