Backend Routes - nicolaspiper/Instakilogram GitHub Wiki
Root
GET
Controller Action static_pages#root
Route /
APIs
users
GET
Controller Action api/users#index
Route /api/users/:id
gets user information
POST
Controller Action api/users#create
Route /api/users
sign up
sessions
POST
Controller Action api/session#create
Route /api/session
creates new session/login
DELETE
Controller Action api/session#destroy
Route /api/session
logout
posts
GET
Controller Action api/posts#index
Route /api/posts
gets all posts (will later only be posts made by user's follows) by most recent
POST
Controller Action api/posts#create
Route /api/posts
creates new post
GET
Controller Action api/posts#edit
Route /api/post/:post_id/edit
edit a post
PATCH
Controller Action api/posts#update
Route /api/post/:post_id
updates edited post in database
GET
Controller Action api/posts#show
Route /api/post/:post_id
fetches post
DELETE
Controller Action api/posts#destroy
Route /api/post/:post_id
deletes post
comments
GET
Controller Action api/comments#index
Route /api/comments
gets all comments (will later only be comments made on shown posts)
POST
Controller Action api/comments#create
Route /api/comments
creates new comment
GET
Controller Action api/comments#edit
Route /api/comment/:comment_id/edit
edit a comment
PATCH
Controller Action api/comment#update
Route /api/comment/:comment_id
updates edited comment in database
DELETE
Controller Action api/comments#destroy
Route /api/comment/:comment_id
deletes comment
post_likes
GET
Controller Action api/post_likes#index
Route /api/post_likes
gets all post_likes (will later only be post_likes of the current posts that are shown)
POST
Controller Action api/post_likes/:post_id#create
Route /api/post_likes
creates new post_likes relationship between two users
DELETE
Controller Action api/post_likes/:post_id#destroy
Route /api/post_likes/:post_id
deletes post_likes relationship
comment_likes
GET
Controller Action api/comment_likes#index
Route /api/comment_likes
gets all comment_likes (will later only be comment_likes of the current comments that are shown)
POST
Controller Action api/comment_likes/:comment_id#create
Route /api/comment_likes
creates new comment_like relationship between two users
DELETE
Controller Action api/comment_likes/:comment_id#destroy
Route /api/comment_likes/:comment_id
deletes comment_likes relationship
🗂️ Page Index for this GitHub Wiki