routes.rb 356 Bytes
Newer Older
1
# Registers all routes for the app.
Zac Wood's avatar
Zac Wood committed
2
Rails.application.routes.draw do
3
  scope :api do # Register /api routes
4
5
    resources :courses, only: [:index, :show]
    resources :course_sections, only: [:index]
Zac Wood's avatar
Zac Wood committed
6

Zac Wood's avatar
Zac Wood committed
7
    post 'generate', controller: 'calendar_generator', action: 'generate'
Zac Wood's avatar
Zac Wood committed
8
9
  end

Zac Wood's avatar
Zac Wood committed
10
  root 'courses#index' # Set the root to be the courses API endpoint
Zac Wood's avatar
Zac Wood committed
11
end