2014-07-30 05:24:20 +00:00
|
|
|
Metamaps::Application.routes.draw do
|
2012-09-23 02:39:12 +00:00
|
|
|
|
2016-03-19 02:28:55 +00:00
|
|
|
use_doorkeeper
|
2013-01-08 04:03:41 +00:00
|
|
|
root to: 'main#home', via: :get
|
2012-09-23 02:39:12 +00:00
|
|
|
|
2015-09-10 14:06:58 +00:00
|
|
|
get 'request', to: 'main#requestinvite', as: :request
|
2012-10-29 17:52:29 +00:00
|
|
|
|
2015-09-10 14:06:58 +00:00
|
|
|
get 'search/topics', to: 'main#searchtopics', as: :searchtopics
|
|
|
|
get 'search/maps', to: 'main#searchmaps', as: :searchmaps
|
|
|
|
get 'search/mappers', to: 'main#searchmappers', as: :searchmappers
|
|
|
|
get 'search/synapses', to: 'main#searchsynapses', as: :searchsynapses
|
2012-12-23 06:12:56 +00:00
|
|
|
|
2016-03-11 06:16:04 +00:00
|
|
|
namespace :api, path: '/api/v1', defaults: {format: :json} do
|
|
|
|
resources :maps, only: [:create, :show, :update, :destroy]
|
|
|
|
resources :synapses, only: [:create, :show, :update, :destroy]
|
|
|
|
resources :topics, only: [:create, :show, :update, :destroy]
|
|
|
|
resources :mappings, only: [:create, :show, :update, :destroy]
|
|
|
|
resources :tokens, only: [ :create, :destroy] do
|
|
|
|
get :my_tokens, on: :collection
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2015-12-11 19:23:41 +00:00
|
|
|
resources :messages, only: [:show, :create, :update, :destroy]
|
2014-07-30 05:24:20 +00:00
|
|
|
resources :mappings, except: [:index, :new, :edit]
|
2014-06-11 23:18:59 +00:00
|
|
|
resources :metacode_sets, :except => [:show]
|
2016-03-26 02:12:32 +00:00
|
|
|
|
|
|
|
resources :metacodes, :except => [:destroy]
|
|
|
|
get 'metacodes/:name', to: 'metacodes#show'
|
|
|
|
|
2014-07-30 05:24:20 +00:00
|
|
|
resources :synapses, except: [:index, :new, :edit]
|
2014-02-05 17:37:21 +00:00
|
|
|
resources :topics, except: [:index, :new, :edit] do
|
2014-01-29 03:46:58 +00:00
|
|
|
get :autocomplete_topic, :on => :collection
|
2012-12-14 07:16:17 +00:00
|
|
|
end
|
2015-09-10 14:06:58 +00:00
|
|
|
get 'topics/:id/network', to: 'topics#network', as: :network
|
|
|
|
get 'topics/:id/relative_numbers', to: 'topics#relative_numbers', as: :relative_numbers
|
|
|
|
get 'topics/:id/relatives', to: 'topics#relatives', as: :relatives
|
2012-12-14 07:16:17 +00:00
|
|
|
|
2016-02-13 09:42:36 +00:00
|
|
|
resources :maps, except: [:index, :new, :edit]
|
2016-03-26 03:31:55 +00:00
|
|
|
get 'maps/:id/export', to: 'maps#export'
|
2016-04-14 18:35:28 +00:00
|
|
|
post 'maps/:id/events/:event', to: 'maps#events'
|
|
|
|
get 'maps/:id/contains', to: 'maps#contains', as: :contains
|
|
|
|
post 'maps/:id/upload_screenshot', to: 'maps#screenshot', as: :screenshot
|
2016-04-24 15:50:35 +00:00
|
|
|
post 'maps/:id/access', to: 'maps#access', as: :access, defaults: {format: :json}
|
2016-03-26 03:31:55 +00:00
|
|
|
|
2016-02-13 09:42:36 +00:00
|
|
|
get 'explore/active', to: 'maps#activemaps'
|
|
|
|
get 'explore/featured', to: 'maps#featuredmaps'
|
|
|
|
get 'explore/mine', to: 'maps#mymaps'
|
2016-04-24 15:50:35 +00:00
|
|
|
get 'explore/shared', to: 'maps#sharedmaps'
|
2016-02-13 09:42:36 +00:00
|
|
|
get 'explore/mapper/:id', to: 'maps#usermaps'
|
2012-12-16 20:00:43 +00:00
|
|
|
|
2015-09-10 14:06:58 +00:00
|
|
|
devise_for :users, controllers: { registrations: 'users/registrations', passwords: 'users/passwords', sessions: 'devise/sessions' }, :skip => :sessions
|
2014-10-07 21:46:09 +00:00
|
|
|
|
|
|
|
devise_scope :user do
|
|
|
|
get 'login' => 'devise/sessions#new', :as => :new_user_session
|
|
|
|
post 'login' => 'devise/sessions#create', :as => :user_session
|
|
|
|
get 'logout' => 'devise/sessions#destroy', :as => :destroy_user_session
|
2015-09-19 12:46:10 +00:00
|
|
|
get 'join' => 'devise/registrations#new', :as => :new_user_registration_path
|
2014-01-29 03:46:58 +00:00
|
|
|
end
|
2014-10-07 21:46:09 +00:00
|
|
|
|
2015-09-10 14:06:58 +00:00
|
|
|
get 'users/:id/details', to: 'users#details', as: :details
|
|
|
|
post 'user/updatemetacodes', to: 'users#updatemetacodes', as: :updatemetacodes
|
2014-07-30 05:24:20 +00:00
|
|
|
resources :users, except: [:index, :destroy]
|
2012-09-23 02:39:12 +00:00
|
|
|
end
|