Skip to content

Backend Express Routing

Conrad Orta edited this page Jul 10, 2020 · 6 revisions

Main Component Routes

'/'

  • GET / - Renders the default page

'/login'

  • GET /login - Render form to enter email credentials
  • POST /login - Submits the email credtials, redirect to GET /login/password
  • POST /login/password - Submits the password to the server and redirect to GET /account/profile/select if more than one profile
  • POST /account/profile/select - Set the current profile and redirect to /home

'/home'

  • GET /home - Renders the catalogue

'/search'

  • GET /search - Render the search page
  • PATCH /search - Update to display matched results

'/watchlist'

  • GET /watchlist - Render the associated watchlist for current profile

'/movies'

  • GET /movies - Renders all movies
  • GET /movies/:id - Render the associated id movie
  • DELETE /movies/:id - Deletes from watch list

'/series'

  • GET /series - Renders all series
  • GET /series/:id - Renders the associated id series
  • DELETE /series/:id - Deletes from watch list

'/select-avatar'

  • GET /select-avatar - Render possible avatars for a profile when you add or edit a profile
  • PATCH /select-avatar - Save the selected avatar to the profile redirect GET /account/profile/add or account/profile/edit

'/account/profile'

  • GET /add - Renders the add profile screen to add name and kid options
  • POST /add:id - Save newly added profile redirects GET account/profile/select
  • GET /select - Renders a screen to select current profile
  • POST /select - Set the current profile and redirect to GET /home
  • GET /edit - Renders a screen with all available profiles
  • GET /edit:id - Renders a screen to edit the selected profile
  • PATCH /edit - Updates the profiles and redirects to GET account/profile/select
  • PATCH /edit:id - Updates the preferences for a selected profile and redirects to GET account/profile/select
  • DESTROY /edit:id - Deletes selected profile and redirects to GET account/profile/edit

'/brand'

  • GET /brand/:id