Backend routes - pauchye/ASTRA GitHub Wiki

HTML

  • GET / StaticPagesController#root

users

  • GET /api/users/:id - user's show page (user's info and stats)
  • PATCH /api/users/:id - user's edit page
  • POST /api/users - sign up

session

  • POST /api/session - log in
  • DELETE /api/session - log out

routes

  • GET /api/routes - returns all routes
  • GET /api/users/:user_id/routes - returns all user's routes
  • GET /api/routes/:id - shows a single route
  • POST /api/routes - creates a route
  • PATCH /api/routes/:id - edit a route
  • DELETE /api/routes/:id - remove a route

workouts

  • GET /api/users/:user_id/workouts - returns all workouts filtered by user (algorithm as a bonus) and sorted by date
  • GET /api/workouts/:id - shows a single workout
  • POST /api/workouts - creates a route
  • PATCH /api/workouts/:id - edit a route
  • DELETE /api/workouts/:id - remove a route