MarynaMartseniuk / Note-Taker-ch11

Note Taker is an App that can be used to write and save notes. This application uses an Express.js back end and saves and retrieves note data from a JSON file.
MIT License
0 stars 0 forks source link

change file structure #12

Closed MarynaMartseniuk closed 3 months ago

MarynaMartseniuk commented 3 months ago

expected: when user use 'http://localhost:3001/api/notes' URL then server.js refers to index.js in the routes-folder, and then to notes.js in the routes-folder. API-routs are executed from notes.js.

now: when user use 'http://localhost:3001/api/notes' URL then server.js refers to index.js in the routes-folder. Process stops at comand 'router.use('/notes', notesRouter);', and then do not go to notes.js in the routes-folder. API-routs are not executed from notes.js.

TODO:

  1. skip rout-folder,
  2. use server.js,
  3. debug
MarynaMartseniuk commented 3 months ago

API-routs are not executed from server.js