Skip to content

Specifications ‐ Backend Routes (Overview)

Seth Laurenceau edited this page Oct 8, 2021 · 5 revisions

Routes Formation

  • Backend Routes: Misc

    Error routes

    404
    triggered upon requesting any undefined route
    provides "Not Found" response
    
    5XX
    triggered upon errors within the server
    provides varying response number depending on error
    provides "500 - server error" response if not status code provided
    

    Base URL /

    GET

    GET /
    homepage root
    this shouldn't be requested of the backend
    provides "OK" response
    
    GET /api
    api root
    no data, default response to avoid 404 indicate the api is functioning
    provides "OK" response
    
  • Backend Routes: Groups

    Base URL /api/groups

    GET

    GET /new
    
    GET/:id/edit
    
    GET/:id/delete
    
    GET /
    
    GET /:id
    
    GET /:id/polls
    
    GET /:id/users
    
    GET /:id/admins
    
    GET /:id/join
    

    POST

    POST /new
    
    POST /:id/edit
    
    POST /:id/delete
    
    POST /
    
    POST /:id
    
    POST /:id/polls
    
    POST /:id/users
    
    POST /:id/admins
    
    POST /:id/join
    
  • Backend Routes: Polls

    Base URL /api/polls

    GET

    GET /new
    
    GET /:id/edit
    
    GET /:id/submit
    
    GET /pollAnswers
    
    GET /:id/delete
    
    GET /
    
    GET /:id
    
    GET /:id/view
    
    GET /:id/results
    

    POST

    POST /new
    
    POST /:id/edit
    
    POST /:id/delete
    
    POST /
    
    POST /:id
    
    POST /:id/polls
    
    POST /:id/users
    
    POST /:id/admins
    
    POST /:id/join
    
  • Backend Routes: Users

    Base URL /api/users

    GET

    GET /api/users
    
    GET /api/users/login
    
    GET /api/users/login/rpi
    
    GET /api/users/register
    
    GET /api/users/register/rpi
    
    GET /api/users/logout
    
    GET /api/users/id/edit
    
    GET /api/users/id
    
    GET /api/users/id/groups
    

    POST

    POST /api/users
    
    POST /api/users/login
    
    POST /api/users/login/rpi
    
    POST /api/users/register
    
    POST /api/users/register/rpi
    
    POST /api/users/logout
    
    POST /api/users/id/edit
    
    POST /api/users/id
    
    POST /api/users/id/groups