Question: Add a GET route for / that reads and returns index.html using the readFile ( ) fs function. Use an arrow function for the second

Add a GET route for / that reads and returns index.html using the readFile() fs function. Use an arrow function for the second parameter of readFile(). Use Node.js __dirname variable to get the appropriate path for index.html. Include the appropriate Content-Type MIME header type. If no error occurs, also include a status code of 200. If an error occurs, return a status code of 500.

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 Finance Questions!