Question: Need help with this assignment. Any help is appreciated.You'll need to use node.js - not javascript. Assignment is below: Write a Node.js program that does

Need help with this assignment. Any help is appreciated.You'll need to use node.js - not javascript.

Assignment is below:

Need help with this assignment. Any help is appreciated.You'll need to use

node.js - not javascript. Assignment is below: Write a Node.js program that

Write a Node.js program that does the following Save the program to a file named 8.js Create a POST request: o The path is: POST /addGrade o The request body is a JSON object. For example: first": "Bilbo", "last": "Baggins","grade":99 o The three request fields are appended to a file named grades.txt, separated by commas. For example: Bilbo, Baggins,99 John, Smith,89 Arya,Stark,100 o If the add succedes, return a 200 status and this JSON object: "msg" "success" o If the add fails, return a 200 status and this JSON object: "msg" "fail". Test this route with a curl command Create a GET request o The path is: GET /getAllGrades o The response is an HTML page that lists all of the grades in the grades.txt file o Test this route by visiting the URL in a browser o Delete the grades.txt file and test it again. It should return an HTML page that says Error . Create a GET reque Write a Node.js program that does the following Save the program to a file named 8.js Create a POST request: o The path is: POST /addGrade o The request body is a JSON object. For example: first": "Bilbo", "last": "Baggins","grade":99 o The three request fields are appended to a file named grades.txt, separated by commas. For example: Bilbo, Baggins,99 John, Smith,89 Arya,Stark,100 o If the add succedes, return a 200 status and this JSON object: "msg" "success" o If the add fails, return a 200 status and this JSON object: "msg" "fail". Test this route with a curl command Create a GET request o The path is: GET /getAllGrades o The response is an HTML page that lists all of the grades in the grades.txt file o Test this route by visiting the URL in a browser o Delete the grades.txt file and test it again. It should return an HTML page that says Error . Create a GET reque

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!