routes.rb 428 Bytes
Newer Older
1
# Registers all routes for the app.
Zac Wood's avatar
Zac Wood committed
2
Rails.application.routes.draw do
Zac Wood's avatar
Zac Wood committed
3
  get 'search', to: 'search#index'
4
  get 'search/update', to: 'search#update'
Zac Wood's avatar
Zac Wood committed
5

6
  scope :api do # Register /api routes
7
8
    resources :courses, only: [:index, :show]
    resources :course_sections, only: [:index]
9
    resources :schedules, only: [:index]
Zac Wood's avatar
Zac Wood committed
10
11
  end

Zac Wood's avatar
Zac Wood committed
12
13
  apipie # sets up API docs
  get '/', to: redirect('/api') # redirect the root url to API docs
Zac Wood's avatar
Zac Wood committed
14
end