Question
I need to create a server using Node.js, HTTP, and mocha testing framework Instructions to complete the server.js file: use the File System module to
I need to create a server using Node.js, HTTP, and mocha testing framework
Instructions to complete the server.js file:
use the File System module to load testings.json into memory
create a request handler with the URL module to send the testing data on a GET request to localhost:8080/testings
use the HTTP module to create a server that makes use of this request handler
implement the server in server.js, then test it using test.server.js
Note:
Your request handler should send listingData in the JSON format if a GET request is sent to the '/testings' path. Otherwise, it should send a 404 error.
Below is the contents the 3 files:
|
|
|
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started