File size: 812 Bytes
f5071ca
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Rails.application.routes.draw do
  # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
  namespace :api, defaults: {format: 'json'} do
    resource :session, only: [:create, :destroy]

    get '/users/url/:user_url', to: 'users#show_by_url'
    get '/users/search', to: 'users#search'
    get '/users/:user_id/friends', to: 'users#friends'
    patch '/users/:user_id/photo', to: 'users#update_photo'
    resources :users, only: [:show, :create]

    resources :posts, except: [:new, :edit]
    get '/users/:user_id/posts', to: 'posts#wall_posts'
    get '/users/:user_id/feed', to: 'posts#feed_posts'

    resources :comments, only: [:show, :create, :update, :destroy]
    get '/posts/:post_id/comments', to: 'comments#index'
  end

  root 'static_pages#root'
end