-
Notifications
You must be signed in to change notification settings - Fork 0
/
routes.rb
26 lines (22 loc) · 1015 Bytes
/
routes.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Rails.application.routes.draw do
root to: 'auth#index'
direct(:login) { '/auth/calnet' } # convenience to provide login_url helper
get '/logout', to: 'auth#logout', as: :logout
get '/auth/:provider/callback', to: 'auth#callback', as: :omniauth_callback
defaults format: :jsonapi do
constraints(->(req) { req.format == :jsonapi }) do
resources :closures
resources :items
resources :terms, only: :index
resources :facets, only: :index
resources :reservations, only: :create
resources :users, only: :show
resources :build_info, only: :index
end
end
post '/images', constraints: ->(req) { req.form_data? }, to: 'images#create', defaults: { format: :txt }
get '/images/:id', to: 'images#show', as: :image, defaults: { format: :jsonapi }
get '/images/:id/thumbnail', to: 'images#thumbnail', as: :thumbnail
delete '/images/:id', to: 'images#destroy'
direct(:current_user) { '/users/current' } # convenience to provide current_user_url helper
end