OpenStreetMap::Application.routes.draw do
# API
namespace :api do
- get "capabilities" => "capabilities#show"
+ get "capabilities" => "capabilities#show" # Deprecated, remove when 0.6 support is removed
+ get "versions" => "versions#show"
end
scope "api/0.6" do
get "changes" => "api/changes#index"
- get "search" => "api/search#search_all", :as => "api_search"
- get "ways/search" => "api/search#search_ways"
- get "relations/search" => "api/search#search_relations"
- get "nodes/search" => "api/search#search_nodes"
-
get "user/:id" => "api/users#show", :id => /\d+/
get "user/details" => "api/users#details"
get "user/gpx_files" => "api/users#gpx_files"
get "users" => "api/users#index", :as => :api_users
- get "user/preferences" => "api/user_preferences#read"
- get "user/preferences/:preference_key" => "api/user_preferences#read_one"
- put "user/preferences" => "api/user_preferences#update"
- put "user/preferences/:preference_key" => "api/user_preferences#update_one"
- delete "user/preferences/:preference_key" => "api/user_preferences#delete_one"
+ get "user/preferences" => "api/user_preferences#index"
+ get "user/preferences/:preference_key" => "api/user_preferences#show"
+ put "user/preferences" => "api/user_preferences#update_all"
+ put "user/preferences/:preference_key" => "api/user_preferences#update"
+ delete "user/preferences/:preference_key" => "api/user_preferences#destroy"
post "gpx/create" => "api/traces#create"
get "gpx/:id" => "api/traces#show", :id => /\d+/
# AMF (ActionScript) API
post "amf/read" => "api/amf#amf_read"
post "amf/write" => "api/amf#amf_write"
- get "swf/trackpoints" => "api/swf#trackpoints"
# Map notes API
resources :notes, :except => [:new, :edit, :update], :constraints => { :id => /\d+/ }, :defaults => { :format => "xml" }, :controller => "api/notes" do
get "/trace/create", :to => redirect(:path => "/traces/new")
get "/trace/:id/data" => "traces#data", :id => /\d+/, :as => "trace_data"
get "/trace/:id/edit", :to => redirect(:path => "/traces/%{id}/edit")
- post "/trace/:id/delete" => "traces#delete", :id => /\d+/
# diary pages
resources :diary_entries, :path => "diary", :only => [:new, :create, :index] do
end
post "/user/:display_name/diary/:id/newcomment" => "diary_entries#comment", :id => /\d+/
post "/user/:display_name/diary/:id/hide" => "diary_entries#hide", :id => /\d+/, :as => :hide_diary_entry
+ post "/user/:display_name/diary/:id/unhide" => "diary_entries#unhide", :id => /\d+/, :as => :unhide_diary_entry
post "/user/:display_name/diary/:id/hidecomment/:comment" => "diary_entries#hidecomment", :id => /\d+/, :comment => /\d+/, :as => :hide_diary_comment
+ post "/user/:display_name/diary/:id/unhidecomment/:comment" => "diary_entries#unhidecomment", :id => /\d+/, :comment => /\d+/, :as => :unhide_diary_comment
post "/user/:display_name/diary/:id/subscribe" => "diary_entries#subscribe", :as => :diary_entry_subscribe, :id => /\d+/
post "/user/:display_name/diary/:id/unsubscribe" => "diary_entries#unsubscribe", :as => :diary_entry_unsubscribe, :id => /\d+/