Skip to content

Backend Routes

Micah Jaffe edited this page Dec 11, 2018 · 4 revisions

Root page

  • GET / - StaticPagesController#root

API Endpoints

users

  • POST /api/users - sign up

session

  • POST /api/session - login
  • DELETE /api/session - logout

notebooks

  • GET /api/notebooks - get all of user's notebooks (notebooks index page)
  • POST /api/notebooks - create a new notebook
  • PATCH /api/notebooks/:id - edit notebook name
  • DELETE /api/notebooks/:id - delete notebook
    • Will need some logic to prevent user from deleting their last notebook
  • GET /api/notebooks/:notebook_id - show notebook (i.e. notebook title and all associated notes, main app page)

notes

  • GET /api/notes - get all of user's notes under heading "All Notebooks" (all notes index page)
  • PATCH /api/notes/:id - edit a note
  • DELETE /api/notes/:id - delete a note
  • POST /api/notebooks/:notebook_id/notes - create a note in given notebook

tags

  • GET /api/tags - get all tags (tags index page)
  • POST /api/tags - create a new tag
  • DELETE /api/tags/:id - delete a tag
Clone this wiki locally