forked from OpenNeo/impress
Matchu
010f64264f
Preparing a better endpoint for wardrobe-2020 to use! I deleted the now-unused swf_assets#index endpoint, and replaced it with an "appearances" concept that isn't exactly reflected in the database models but is a _lot_ easier for clients to work with imo. Note that this was a big part of the motivation for the recent `manifest_url` work—in this draft, I'm probably gonna have the client request the manifest, rather than use impress-2020's trick of caching it in the database! There's a bit of a perf penalty, but I think that's a simpler starting point, and I have a hunch I'll be able to make up the perf difference once we have the impress-media-server managing more of these responsibilities.
90 lines
No EOL
3 KiB
Ruby
90 lines
No EOL
3 KiB
Ruby
OpenneoImpressItems::Application.routes.draw do
|
|
root :to => 'outfits#new'
|
|
|
|
# TODO: It's a bit silly that outfits/new points to outfits#edit.
|
|
# Should we refactor the controller/view structure here?
|
|
get '/outfits/new', to: 'outfits#edit', as: :wardrobe
|
|
get '/wardrobe' => redirect('/outfits/new')
|
|
get '/start/:color_name/:species_name' => 'outfits#start'
|
|
|
|
get '/species/:species_id/color/:color_id/pet_type.json' => 'pet_types#show'
|
|
|
|
resources :contributions, :only => [:index]
|
|
resources :items, :only => [:index, :show] do
|
|
resources :appearances, controller: 'item_appearances', only: [:index]
|
|
collection do
|
|
get :needed
|
|
end
|
|
end
|
|
resources :outfits, :only => [:show, :create, :update, :destroy]
|
|
resources :pet_attributes, :only => [:index]
|
|
resources :swf_assets, :only => [:show] do
|
|
collection do
|
|
get :links
|
|
end
|
|
end
|
|
resources :zones, only: [:index]
|
|
|
|
scope 'import' do
|
|
resources :neopets_page_import_tasks, only: [:new, :create],
|
|
path: ':page_type/pages/:expected_index'
|
|
end
|
|
|
|
get '/your-outfits', to: 'outfits#index', as: :current_user_outfits
|
|
get '/users/current-user/outfits', to: redirect('/your-outfits')
|
|
|
|
post '/pets/load' => 'pets#load', :as => :load_pet
|
|
get '/modeling' => 'pets#bulk', :as => :bulk_pets
|
|
|
|
devise_for :auth_users
|
|
|
|
post '/locales/choose' => 'locales#choose', :as => :choose_locale
|
|
|
|
get "petpages/new"
|
|
get "closet_lists/new"
|
|
get "closet_lists/create"
|
|
|
|
resources :users, :path => 'user', :only => [:index, :update] do
|
|
resources :contributions, :only => [:index]
|
|
resources :closet_hangers, :only => [:index, :update, :destroy], :path => 'closet' do
|
|
collection do
|
|
get :petpage
|
|
put :update
|
|
delete :destroy
|
|
end
|
|
end
|
|
resources :closet_lists, :only => [:new, :create, :edit, :update, :destroy], :path => 'closet/lists'
|
|
|
|
resources :items, :only => [] do
|
|
resources :closet_hangers, :only => [:create] do
|
|
collection do
|
|
put :update_quantities
|
|
end
|
|
end
|
|
end
|
|
|
|
resources :neopets_connections, path: 'neopets-connections',
|
|
only: [:create, :destroy]
|
|
end
|
|
|
|
resources :donations, only: [:create, :show, :update] do
|
|
collection do
|
|
resources :donation_features, path: 'features', only: [:index]
|
|
end
|
|
end
|
|
|
|
resources :campaigns, only: [:show], path: '/donate/campaigns'
|
|
get '/donate' => 'campaigns#current', as: :donate
|
|
|
|
get 'users/current-user/closet' => 'closet_hangers#index', :as => :your_items
|
|
|
|
get 'users/top-contributors' => 'users#top_contributors', :as => :top_contributors
|
|
get 'users/top_contributors' => redirect('/users/top-contributors')
|
|
|
|
get 'image-mode' => 'static#image_mode', :as => :image_mode
|
|
get '/pardon-our-dust' => 'static#pardon_our_dust', :as => :pardon_our_dust
|
|
get '/terms' => redirect("https://impress-2020.openneo.net/terms"), :as => :terms
|
|
|
|
get '/sitemap.xml' => 'sitemap#index', :as => :sitemap, :format => :xml
|
|
get '/robots.txt' => 'sitemap#robots', :as => :robots, :format => :text
|
|
end |