|
|
|
@@ -1,46 +1,60 @@ |
|
|
|
Rails.application.routes.draw do |
|
|
|
get 'tags/nico', to: 'nico_tags#index' |
|
|
|
put 'tags/nico/:id', to: 'nico_tags#update' |
|
|
|
get 'tags/autocomplete', to: 'tags#autocomplete' |
|
|
|
get 'tags/name/:name', to: 'tags#show_by_name' |
|
|
|
get 'posts/random', to: 'posts#random' |
|
|
|
get 'posts/changes', to: 'posts#changes' |
|
|
|
post 'posts/:id/viewed', to: 'posts#viewed' |
|
|
|
delete 'posts/:id/viewed', to: 'posts#unviewed' |
|
|
|
get 'preview/title', to: 'preview#title' |
|
|
|
get 'preview/thumbnail', to: 'preview#thumbnail' |
|
|
|
get 'wiki/title/:title', to: 'wiki_pages#show_by_title' |
|
|
|
get 'wiki/search', to: 'wiki_pages#search' |
|
|
|
get 'wiki/changes', to: 'wiki_pages#changes' |
|
|
|
get 'wiki/:id/diff', to: 'wiki_pages#diff' |
|
|
|
get 'wiki/:id', to: 'wiki_pages#show' |
|
|
|
get 'wiki', to: 'wiki_pages#index' |
|
|
|
post 'wiki', to: 'wiki_pages#create' |
|
|
|
put 'wiki/:id', to: 'wiki_pages#update' |
|
|
|
post 'users/code/renew', to: 'users#renew' |
|
|
|
|
|
|
|
resources :posts |
|
|
|
resources :ip_addresses |
|
|
|
resources :nico_tag_relations |
|
|
|
resources :post_tags |
|
|
|
resources :settings |
|
|
|
resources :tag_aliases |
|
|
|
resources :tags |
|
|
|
resources :user_ips |
|
|
|
resources :user_post_views |
|
|
|
resources :nico_tags, path: 'tags/nico', only: [:index, :update] |
|
|
|
|
|
|
|
resources :tags do |
|
|
|
collection do |
|
|
|
get :autocomplete |
|
|
|
get 'name/:name', action: :show_by_name |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
scope :preview, controller: :preview do |
|
|
|
get :title |
|
|
|
get :thumbnail |
|
|
|
end |
|
|
|
|
|
|
|
resources :wiki_pages, path: 'wiki', only: [:index, :show, :create, :update] do |
|
|
|
collection do |
|
|
|
get :search |
|
|
|
get :changes |
|
|
|
|
|
|
|
scope :title do |
|
|
|
get ':title/exists', action: :exists_by_title |
|
|
|
get ':title', action: :show_by_title |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
member do |
|
|
|
get :exists |
|
|
|
get :diff |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
resources :posts do |
|
|
|
collection do |
|
|
|
get :random |
|
|
|
get :changes |
|
|
|
end |
|
|
|
|
|
|
|
member do |
|
|
|
post :viewed |
|
|
|
delete :viewed, action: :unviewed |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
resources :users, only: [:create, :update] do |
|
|
|
collection do |
|
|
|
post :verify |
|
|
|
get :me |
|
|
|
post 'code/renew', action: :renew |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
# Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html |
|
|
|
|
|
|
|
# Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500. |
|
|
|
# Can be used by load balancers and uptime monitors to verify that the app is live. |
|
|
|
# get "up" => "rails/health#show", as: :rails_health_check |
|
|
|
|
|
|
|
# Defines the root path route ("/") |
|
|
|
# root "posts#index" |
|
|
|
resources :ip_addresses |
|
|
|
resources :nico_tag_relations |
|
|
|
resources :post_tags |
|
|
|
resources :settings |
|
|
|
resources :tag_aliases |
|
|
|
resources :user_ips |
|
|
|
resources :user_post_views |
|
|
|
end |