Skip to content

Commit

Permalink
Copilot third commit
Browse files Browse the repository at this point in the history
  • Loading branch information
amrithss committed Aug 22, 2024
1 parent f1e8b1c commit 5855094
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions comments.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Create web server
// 1. Create a new file called comments.js in the routes directory.
// 2. In the comments.js file, import the express module and create a new Router object.
// 3. Create a new route in the comments.js file that listens for GET requests to the /comments path.
// 4. In the route handler, read the comments.json file using the fs module and send the contents of the file as a JSON response.
// 5. Export the Router object from the comments.js file.
// 6. Update the app.js file to use the comments route.
// 7. In the app.js file, import the comments route and use the route to handle GET requests to the /comments path.
// 8. Start the web server and test the /comments route in your browser.
// 9. In the terminal, run the node app.js command to start the web server.
// 10. Open a web browser and navigate to http://localhost:3000/comments to see the comments data.

0 comments on commit 5855094

Please sign in to comment.