As a small business owner, I want a note taking application to keep track of titles and body text.
GitHub repository: https://github.com/tdickson96/Note-Taker
Heroku: https://note-taker-example.herokuapp.com/notes
On the back end, the application should include a db.json
file that will be used to store and retrieve notes using the fs
module.
The following HTML routes should be created:
-
GET /notes
should return thenotes.html
file. -
GET *
should return theindex.html
file.
The following API routes should be created:
-
GET /api/notes
should read thedb.json
file and return all saved notes as JSON. -
POST /api/notes
should receive a new note to save on the request body, add it to thedb.json
file, and then return the new note to the client. You'll need to find a way to give each note a unique id when it's saved (look into npm packages that could do this for you). -
DELETE /api/notes/:id
should receive a query parameter that contains the id of a note to delete. To delete a note, you'll need to read all notes from thedb.json
file, remove the note with the givenid
property, and then rewrite the notes to thedb.json
file.
Trent Dickson
© 2022 Trilogy Education Services, LLC, a 2U, Inc. brand. Confidential and Proprietary. All Rights Reserved.