2015-09-25 14:37:55 +00:00
|
|
|
Rails.application.routes.draw do
|
2012-04-10 14:06:46 +00:00
|
|
|
|
|
|
|
# app init
|
2015-04-27 13:42:53 +00:00
|
|
|
match '/init', to: 'init#index', via: :get
|
|
|
|
match '/app', to: 'init#index', via: :get
|
2012-04-10 13:31:21 +00:00
|
|
|
|
|
|
|
# just remember to delete public/index.html.
|
2015-04-27 13:42:53 +00:00
|
|
|
root to: 'init#index', via: :get
|
2020-02-13 10:49:33 +00:00
|
|
|
root to: 'errors#routing', via: %i[post put delete options]
|
2012-05-18 13:54:48 +00:00
|
|
|
|
2013-08-22 20:29:24 +00:00
|
|
|
# load routes from external files
|
2018-04-12 14:57:37 +00:00
|
|
|
dir = File.expand_path(__dir__)
|
2013-08-22 20:29:24 +00:00
|
|
|
files = Dir.glob( "#{dir}/routes/*.rb" )
|
2017-10-01 12:25:52 +00:00
|
|
|
files.each do |file|
|
2014-02-19 04:31:36 +00:00
|
|
|
if Rails.configuration.cache_classes
|
2018-10-18 12:22:02 +00:00
|
|
|
require_dependency file
|
2014-02-19 04:31:36 +00:00
|
|
|
else
|
|
|
|
load file
|
|
|
|
end
|
2017-10-01 12:25:52 +00:00
|
|
|
end
|
2013-08-22 20:29:24 +00:00
|
|
|
|
2020-02-13 10:49:33 +00:00
|
|
|
match '*a', to: 'errors#routing', via: %i[get post put delete options]
|
2015-04-27 14:15:29 +00:00
|
|
|
end
|