2013-01-09 00:14:05 -05:00
|
|
|
require 'sidekiq/web'
|
2015-12-03 18:24:39 -05:00
|
|
|
require 'sidekiq/cron/web'
|
2013-05-14 08:33:31 -04:00
|
|
|
require 'api/api'
|
2013-01-09 00:14:05 -05:00
|
|
|
|
2016-10-05 08:21:27 -04:00
|
|
|
class ActionDispatch::Routing::Mapper
|
|
|
|
def draw(routes_name)
|
|
|
|
instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb")))
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2015-11-25 11:18:44 -05:00
|
|
|
Rails.application.routes.draw do
|
2016-06-01 12:07:23 -04:00
|
|
|
concern :access_requestable do
|
|
|
|
post :request_access, on: :collection
|
2016-06-01 12:17:03 -04:00
|
|
|
post :approve_access_request, on: :member
|
2016-06-01 12:07:23 -04:00
|
|
|
end
|
|
|
|
|
2016-09-19 03:26:37 -04:00
|
|
|
concern :awardable do
|
|
|
|
post :toggle_award_emoji, on: :member
|
|
|
|
end
|
|
|
|
|
2016-10-05 11:43:47 -04:00
|
|
|
draw :sherlock
|
|
|
|
draw :development
|
|
|
|
draw :ci
|
2015-08-25 21:42:46 -04:00
|
|
|
|
2014-12-19 09:15:29 -05:00
|
|
|
use_doorkeeper do
|
2015-02-02 22:30:09 -05:00
|
|
|
controllers applications: 'oauth/applications',
|
|
|
|
authorized_applications: 'oauth/authorized_applications',
|
|
|
|
authorizations: 'oauth/authorizations'
|
2014-12-19 09:15:29 -05:00
|
|
|
end
|
2015-03-08 17:46:22 -04:00
|
|
|
|
2015-03-26 22:06:19 -04:00
|
|
|
# Autocomplete
|
|
|
|
get '/autocomplete/users' => 'autocomplete#users'
|
|
|
|
get '/autocomplete/users/:id' => 'autocomplete#user'
|
2016-05-16 10:24:51 -04:00
|
|
|
get '/autocomplete/projects' => 'autocomplete#projects'
|
2015-03-26 22:06:19 -04:00
|
|
|
|
2016-02-22 21:16:00 -05:00
|
|
|
# Emojis
|
|
|
|
resources :emojis, only: :index
|
2015-03-26 22:06:19 -04:00
|
|
|
|
2012-06-13 02:03:53 -04:00
|
|
|
# Search
|
2015-01-19 15:37:20 -05:00
|
|
|
get 'search' => 'search#show'
|
|
|
|
get 'search/autocomplete' => 'search#autocomplete', as: :search_autocomplete
|
2012-02-19 09:35:31 -05:00
|
|
|
|
2016-05-02 07:29:17 -04:00
|
|
|
# JSON Web Token
|
|
|
|
get 'jwt/auth' => 'jwt#auth'
|
|
|
|
|
2016-04-22 12:50:08 -04:00
|
|
|
# Health check
|
2016-05-13 03:51:13 -04:00
|
|
|
get 'health_check(/:checks)' => 'health_check#index', as: :health_check
|
2016-04-22 12:50:08 -04:00
|
|
|
|
2016-07-25 23:59:39 -04:00
|
|
|
# Koding route
|
|
|
|
get 'koding' => 'koding#index'
|
|
|
|
|
2016-10-05 11:43:47 -04:00
|
|
|
draw :api
|
|
|
|
draw :sidekiq
|
|
|
|
draw :help
|
|
|
|
draw :snippets
|
2013-03-24 18:17:20 -04:00
|
|
|
|
2015-04-10 09:22:31 -04:00
|
|
|
# Invites
|
|
|
|
resources :invites, only: [:show], constraints: { id: /[A-Za-z0-9_-]+/ } do
|
|
|
|
member do
|
|
|
|
post :accept
|
2015-04-10 10:37:02 -04:00
|
|
|
match :decline, via: [:get, :post]
|
2015-04-10 09:22:31 -04:00
|
|
|
end
|
|
|
|
end
|
2015-02-11 20:34:41 -05:00
|
|
|
|
2016-01-09 13:32:03 -05:00
|
|
|
resources :sent_notifications, only: [], constraints: { id: /\h{32}/ } do
|
2015-12-09 05:59:25 -05:00
|
|
|
member do
|
|
|
|
get :unsubscribe
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2015-08-06 08:03:27 -04:00
|
|
|
# Spam reports
|
|
|
|
resources :abuse_reports, only: [:new, :create]
|
|
|
|
|
2016-06-14 14:36:36 -04:00
|
|
|
# Notification settings
|
|
|
|
resources :notification_settings, only: [:create, :update]
|
|
|
|
|
2016-10-05 08:21:27 -04:00
|
|
|
draw :import
|
|
|
|
draw :uploads
|
|
|
|
draw :explore
|
|
|
|
draw :admin
|
|
|
|
draw :profile
|
|
|
|
draw :dashboard
|
|
|
|
draw :group
|
|
|
|
draw :user
|
|
|
|
draw :project
|
2011-10-08 17:36:38 -04:00
|
|
|
|
2016-10-05 09:05:26 -04:00
|
|
|
# Get all keys of user
|
|
|
|
get ':username.keys' => 'profiles/keys#get_keys', constraints: { username: /.*/ }
|
|
|
|
|
2015-09-08 09:49:20 -04:00
|
|
|
root to: "root#index"
|
2011-10-08 17:36:38 -04:00
|
|
|
end
|