Link to GitHub Repo: https://github.com/dchiev/Note-Taker
Link to deployed Heroku Application: https://agile-reaches-30799.herokuapp.com/
-
I started with initial routes on seperate folders. After this initally didn't work, I switched all onto a single server.js file.
-
After the application was functional, I then switched all routes back to folders.
-
From the server.js file, I required the seperate route files.
-
For the html routes, I used get routes to server the various html files to the user.
-
To read the JSON, I used
readFileAsync = util.promisify(fs.readFile);to read the JSON database. -
For the api routes, I used a post route with both
readFileAsyncandwriteFileAsyncto read and save the note data. Delete was handeled with a similar structure with the:idroute.
