Skip to content

Backend Routes

StevenSuazo edited this page Nov 16, 2020 · 3 revisions

HTML

  • GET / StaticPagesController#root

API Endpoints

Users

Routes Details
GET /api/users Displays users information and loads the user's Photostream
POST /api/users Signs up a new user

Session

Routes Details
POST /api/users Logs in the user
DELETE /api/users Logs out the current user

Photos

Routes Details
GET /api/photos Displays all available photos
GET /api/photos/:id Displays photo with the matching index
POST /api/photos/ Creates a new photo
PATCH /api/photos/:id Edits the photo with the matching index
DELETE /api/photos/:id Deletes the photo with the matching index

Albums

Routes Details
GET /api/users/user_id/albums Displays all available photo albums
GET /api/albums/:id Displays photo album with the matching index
POST /api/albums Creates a new photo album
PATCH /api/albums/:id Edits the photo album with the matching index
DELETE /api/albums/:id Deletes the photo album with the matching index

Comments

Routes Details
POST /api/photos/photo_id/comments Creates a comment under the photo with the matching index
PATCH /api/comments/:id Edits a comment under the photo with the matching index
DELETE /api/comments/:id Deletes a comment under the photo with the matching index

Tags

Routes Details
POST /api/photos/photo_id/tags Creates a tag under the photo with the matching index
DELETE /api/tags/:id Deletes a tag under the photo with the matching index

Tags Join

Routes Details
POST /api/photos/tag_id Creates a joins tag under the photo with the matching index
DELETE /api/tags/:id Deletes a tag under the photo with the matching index

Photo Album Join

Routes Details
POST /api/albums Creates a new photo album
DELETE /api/albums/:id Deletes the photo album with the matching index

Clone this wiki locally