CYCBrian / Week-11-Express.js-Note-Taker

An application used to write and save notes. This application will use an Express.js back end and will save and retrieve note data from a JSON file.
MIT License
0 stars 0 forks source link

8. export api-routes and html routes #9

Closed CYCBrian closed 10 months ago

CYCBrian commented 10 months ago

modularize all the code i made into two separate folder in the routes folder then link those files to the main server.js file

CYCBrian commented 10 months ago

move apir and html codes to their respective folder.

solved issue of webapp not automatically retrieving data from db.json and displaying it. turned out the it's a problem with the *html route interacting with the order in which the app use code was place. now /api for api routes goes first, then / for html routes.

solved issue where delete function did not work in the web app. I used uuid because it's just what the package is called, but index.js specifically looks for id instead. changed the const uuid to id in the post request in api routes so now it works.

CYCBrian commented 10 months ago

DONE!

CYCBrian commented 10 months ago

forgot to mentions i've also deleted the code i made in server.js because i've moved them to their respective route files. and I've added the paths and what not and exports and requires and WHATEVER I CAN'T BELIEVE I HAVE TO KEEP USING EXPRESS I HATE IT