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

    get 'search', controller: 'search', action: 'index'
Zac Wood's avatar
Zac Wood committed
9
    post 'generate', controller: 'calendar_generator', action: 'generate'
Zac Wood's avatar
Zac Wood committed
10
11
  end

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