1 OpenStreetMap::Application.routes.draw do
4 get "capabilities" => "capabilities#show" # Deprecated, remove when 0.6 support is removed
5 get "versions" => "versions#show"
9 get "capabilities" => "api/capabilities#show"
10 get "permissions" => "api/permissions#show"
12 put "changeset/create" => "api/changesets#create"
13 post "changeset/:id/upload" => "api/changesets#upload", :id => /\d+/
14 get "changeset/:id/download" => "api/changesets#download", :as => :changeset_download, :id => /\d+/
15 post "changeset/:id/expand_bbox" => "api/changesets#expand_bbox", :id => /\d+/
16 get "changeset/:id" => "api/changesets#show", :as => :changeset_show, :id => /\d+/
17 post "changeset/:id/subscribe" => "api/changesets#subscribe", :as => :changeset_subscribe, :id => /\d+/
18 post "changeset/:id/unsubscribe" => "api/changesets#unsubscribe", :as => :changeset_unsubscribe, :id => /\d+/
19 put "changeset/:id" => "api/changesets#update", :id => /\d+/
20 put "changeset/:id/close" => "api/changesets#close", :id => /\d+/
21 get "changesets" => "api/changesets#query"
22 post "changeset/:id/comment" => "api/changeset_comments#create", :as => :changeset_comment, :id => /\d+/
23 post "changeset/comment/:id/hide" => "api/changeset_comments#destroy", :as => :changeset_comment_hide, :id => /\d+/
24 post "changeset/comment/:id/unhide" => "api/changeset_comments#restore", :as => :changeset_comment_unhide, :id => /\d+/
26 put "node/create" => "api/nodes#create"
27 get "node/:id/ways" => "api/ways#ways_for_node", :id => /\d+/
28 get "node/:id/relations" => "api/relations#relations_for_node", :id => /\d+/
29 get "node/:id/history" => "api/old_nodes#history", :id => /\d+/
30 post "node/:id/:version/redact" => "api/old_nodes#redact", :version => /\d+/, :id => /\d+/
31 get "node/:id/:version" => "api/old_nodes#version", :id => /\d+/, :version => /\d+/
32 get "node/:id" => "api/nodes#show", :id => /\d+/
33 put "node/:id" => "api/nodes#update", :id => /\d+/
34 delete "node/:id" => "api/nodes#delete", :id => /\d+/
35 get "nodes" => "api/nodes#index"
37 put "way/create" => "api/ways#create"
38 get "way/:id/history" => "api/old_ways#history", :id => /\d+/
39 get "way/:id/full" => "api/ways#full", :id => /\d+/
40 get "way/:id/relations" => "api/relations#relations_for_way", :id => /\d+/
41 post "way/:id/:version/redact" => "api/old_ways#redact", :version => /\d+/, :id => /\d+/
42 get "way/:id/:version" => "api/old_ways#version", :id => /\d+/, :version => /\d+/
43 get "way/:id" => "api/ways#show", :id => /\d+/
44 put "way/:id" => "api/ways#update", :id => /\d+/
45 delete "way/:id" => "api/ways#delete", :id => /\d+/
46 get "ways" => "api/ways#index"
48 put "relation/create" => "api/relations#create"
49 get "relation/:id/relations" => "api/relations#relations_for_relation", :id => /\d+/
50 get "relation/:id/history" => "api/old_relations#history", :id => /\d+/
51 get "relation/:id/full" => "api/relations#full", :id => /\d+/
52 post "relation/:id/:version/redact" => "api/old_relations#redact", :version => /\d+/, :id => /\d+/
53 get "relation/:id/:version" => "api/old_relations#version", :id => /\d+/, :version => /\d+/
54 get "relation/:id" => "api/relations#show", :id => /\d+/
55 put "relation/:id" => "api/relations#update", :id => /\d+/
56 delete "relation/:id" => "api/relations#delete", :id => /\d+/
57 get "relations" => "api/relations#index"
59 get "map" => "api/map#index"
61 get "trackpoints" => "api/tracepoints#index"
63 get "changes" => "api/changes#index"
65 get "search" => "api/search#search_all", :as => "api_search"
66 get "ways/search" => "api/search#search_ways"
67 get "relations/search" => "api/search#search_relations"
68 get "nodes/search" => "api/search#search_nodes"
70 get "user/:id" => "api/users#show", :id => /\d+/
71 get "user/details" => "api/users#details"
72 get "user/gpx_files" => "api/users#gpx_files"
73 get "users" => "api/users#index", :as => :api_users
75 get "user/preferences" => "api/user_preferences#read"
76 get "user/preferences/:preference_key" => "api/user_preferences#read_one"
77 put "user/preferences" => "api/user_preferences#update"
78 put "user/preferences/:preference_key" => "api/user_preferences#update_one"
79 delete "user/preferences/:preference_key" => "api/user_preferences#delete_one"
81 post "gpx/create" => "api/traces#create"
82 get "gpx/:id" => "api/traces#show", :id => /\d+/
83 put "gpx/:id" => "api/traces#update", :id => /\d+/
84 delete "gpx/:id" => "api/traces#destroy", :id => /\d+/
85 get "gpx/:id/details" => "api/traces#show", :id => /\d+/
86 get "gpx/:id/data" => "api/traces#data"
88 # AMF (ActionScript) API
89 post "amf/read" => "api/amf#amf_read"
90 post "amf/write" => "api/amf#amf_write"
93 resources :notes, :except => [:new, :edit, :update], :constraints => { :id => /\d+/ }, :defaults => { :format => "xml" }, :controller => "api/notes" do
96 get "feed", :defaults => { :format => "rss" }
106 post "notes/addPOIexec" => "api/notes#create"
107 post "notes/closePOIexec" => "api/notes#close"
108 post "notes/editPOIexec" => "api/notes#comment"
109 get "notes/getGPX" => "api/notes#index", :format => "gpx"
110 get "notes/getRSSfeed" => "api/notes#feed", :format => "rss"
114 get "/way/:id" => "browse#way", :id => /\d+/, :as => :way
115 get "/way/:id/history" => "browse#way_history", :id => /\d+/
116 get "/node/:id" => "browse#node", :id => /\d+/, :as => :node
117 get "/node/:id/history" => "browse#node_history", :id => /\d+/
118 get "/relation/:id" => "browse#relation", :id => /\d+/, :as => :relation
119 get "/relation/:id/history" => "browse#relation_history", :id => /\d+/
120 get "/changeset/:id" => "browse#changeset", :as => :changeset, :id => /\d+/
121 get "/changeset/:id/comments/feed" => "changeset_comments#index", :as => :changeset_comments_feed, :id => /\d*/, :defaults => { :format => "rss" }
122 get "/note/:id" => "browse#note", :id => /\d+/, :as => "browse_note"
123 get "/note/new" => "browse#new_note"
124 get "/user/:display_name/history" => "changesets#index"
125 get "/user/:display_name/history/feed" => "changesets#feed", :defaults => { :format => :atom }
126 get "/user/:display_name/notes" => "notes#mine"
127 get "/history/friends" => "changesets#index", :friends => true, :as => "friend_changesets", :defaults => { :format => :html }
128 get "/history/nearby" => "changesets#index", :nearby => true, :as => "nearby_changesets", :defaults => { :format => :html }
130 get "/browse/way/:id", :to => redirect(:path => "/way/%{id}")
131 get "/browse/way/:id/history", :to => redirect(:path => "/way/%{id}/history")
132 get "/browse/node/:id", :to => redirect(:path => "/node/%{id}")
133 get "/browse/node/:id/history", :to => redirect(:path => "/node/%{id}/history")
134 get "/browse/relation/:id", :to => redirect(:path => "/relation/%{id}")
135 get "/browse/relation/:id/history", :to => redirect(:path => "/relation/%{id}/history")
136 get "/browse/changeset/:id", :to => redirect(:path => "/changeset/%{id}")
137 get "/browse/note/:id", :to => redirect(:path => "/note/%{id}")
138 get "/user/:display_name/edits", :to => redirect(:path => "/user/%{display_name}/history")
139 get "/user/:display_name/edits/feed", :to => redirect(:path => "/user/%{display_name}/history/feed")
140 get "/browse/friends", :to => redirect(:path => "/history/friends")
141 get "/browse/nearby", :to => redirect(:path => "/history/nearby")
142 get "/browse/changesets/feed", :to => redirect(:path => "/history/feed")
143 get "/browse/changesets", :to => redirect(:path => "/history")
144 get "/browse", :to => redirect(:path => "/history")
147 root :to => "site#index", :via => [:get, :post]
148 get "/edit" => "site#edit"
149 get "/copyright/:copyright_locale" => "site#copyright"
150 get "/copyright" => "site#copyright"
151 get "/welcome" => "site#welcome"
152 get "/fixthemap" => "site#fixthemap"
153 get "/help" => "site#help"
154 get "/about" => "site#about"
155 get "/history" => "changesets#index"
156 get "/history/feed" => "changesets#feed", :defaults => { :format => :atom }
157 get "/history/comments/feed" => "changeset_comments#index", :as => :changesets_comments_feed, :defaults => { :format => "rss" }
158 get "/export" => "site#export"
159 match "/login" => "users#login", :via => [:get, :post]
160 match "/logout" => "users#logout", :via => [:get, :post]
161 get "/offline" => "site#offline"
162 get "/key" => "site#key"
163 get "/id" => "site#id"
164 get "/query" => "browse#query"
165 get "/user/new" => "users#new"
166 post "/user/new" => "users#create"
167 get "/user/terms" => "users#terms"
168 post "/user/save" => "users#save"
169 get "/user/:display_name/confirm/resend" => "users#confirm_resend"
170 match "/user/:display_name/confirm" => "users#confirm", :via => [:get, :post]
171 match "/user/confirm" => "users#confirm", :via => [:get, :post]
172 match "/user/confirm-email" => "users#confirm_email", :via => [:get, :post]
173 post "/user/go_public" => "users#go_public"
174 match "/user/reset-password" => "users#reset_password", :via => [:get, :post]
175 match "/user/forgot-password" => "users#lost_password", :via => [:get, :post]
176 get "/user/suspended" => "users#suspended"
178 get "/index.html", :to => redirect(:path => "/")
179 get "/create-account.html", :to => redirect(:path => "/user/new")
180 get "/forgot-password.html", :to => redirect(:path => "/user/forgot-password")
183 get "/auth/failure" => "users#auth_failure"
184 match "/auth/:provider/callback" => "users#auth_success", :via => [:get, :post], :as => :auth_success
185 match "/auth/:provider" => "users#auth", :via => [:get, :post], :as => :auth
188 get "/go/:code" => "site#permalink", :code => /[a-zA-Z0-9_@~]+[=-]*/
191 post "/preview/:type" => "site#preview", :as => :preview
194 resources :traces, :except => [:show]
195 get "/user/:display_name/traces/tag/:tag/page/:page" => "traces#index", :page => /[1-9][0-9]*/
196 get "/user/:display_name/traces/tag/:tag" => "traces#index"
197 get "/user/:display_name/traces/page/:page" => "traces#index", :page => /[1-9][0-9]*/
198 get "/user/:display_name/traces" => "traces#index"
199 get "/user/:display_name/traces/tag/:tag/rss" => "traces#georss", :defaults => { :format => :rss }
200 get "/user/:display_name/traces/rss" => "traces#georss", :defaults => { :format => :rss }
201 get "/user/:display_name/traces/:id" => "traces#show"
202 get "/user/:display_name/traces/:id/picture" => "traces#picture"
203 get "/user/:display_name/traces/:id/icon" => "traces#icon"
204 get "/traces/tag/:tag/page/:page" => "traces#index", :page => /[1-9][0-9]*/
205 get "/traces/tag/:tag" => "traces#index"
206 get "/traces/page/:page" => "traces#index", :page => /[1-9][0-9]*/
207 get "/traces/tag/:tag/rss" => "traces#georss", :defaults => { :format => :rss }
208 get "/traces/rss" => "traces#georss", :defaults => { :format => :rss }
209 get "/traces/mine/tag/:tag/page/:page" => "traces#mine", :page => /[1-9][0-9]*/
210 get "/traces/mine/tag/:tag" => "traces#mine"
211 get "/traces/mine/page/:page" => "traces#mine"
212 get "/traces/mine" => "traces#mine"
213 get "/trace/create", :to => redirect(:path => "/traces/new")
214 get "/trace/:id/data" => "traces#data", :id => /\d+/, :as => "trace_data"
215 get "/trace/:id/edit", :to => redirect(:path => "/traces/%{id}/edit")
216 post "/trace/:id/delete" => "traces#delete", :id => /\d+/
219 resources :diary_entries, :path => "diary", :only => [:new, :create, :index] do
221 get "friends" => "diary_entries#index", :friends => true
222 get "nearby" => "diary_entries#index", :nearby => true
225 get "/user/:display_name/diary/rss" => "diary_entries#rss", :defaults => { :format => :rss }
226 get "/diary/:language/rss" => "diary_entries#rss", :defaults => { :format => :rss }
227 get "/diary/rss" => "diary_entries#rss", :defaults => { :format => :rss }
228 get "/user/:display_name/diary/comments/:page" => "diary_entries#comments", :page => /[1-9][0-9]*/
229 get "/user/:display_name/diary/comments/" => "diary_entries#comments"
230 get "/user/:display_name/diary" => "diary_entries#index"
231 get "/diary/:language" => "diary_entries#index"
232 scope "/user/:display_name" do
233 resources :diary_entries, :path => "diary", :only => [:edit, :update, :show]
235 post "/user/:display_name/diary/:id/newcomment" => "diary_entries#comment", :id => /\d+/
236 post "/user/:display_name/diary/:id/hide" => "diary_entries#hide", :id => /\d+/, :as => :hide_diary_entry
237 post "/user/:display_name/diary/:id/unhide" => "diary_entries#unhide", :id => /\d+/, :as => :unhide_diary_entry
238 post "/user/:display_name/diary/:id/hidecomment/:comment" => "diary_entries#hidecomment", :id => /\d+/, :comment => /\d+/, :as => :hide_diary_comment
239 post "/user/:display_name/diary/:id/unhidecomment/:comment" => "diary_entries#unhidecomment", :id => /\d+/, :comment => /\d+/, :as => :unhide_diary_comment
240 post "/user/:display_name/diary/:id/subscribe" => "diary_entries#subscribe", :as => :diary_entry_subscribe, :id => /\d+/
241 post "/user/:display_name/diary/:id/unsubscribe" => "diary_entries#unsubscribe", :as => :diary_entry_unsubscribe, :id => /\d+/
244 get "/user/:display_name" => "users#show", :as => "user"
245 match "/user/:display_name/make_friend" => "users#make_friend", :via => [:get, :post], :as => "make_friend"
246 match "/user/:display_name/remove_friend" => "users#remove_friend", :via => [:get, :post], :as => "remove_friend"
247 match "/user/:display_name/account" => "users#account", :via => [:get, :post]
248 get "/user/:display_name/set_status" => "users#set_status", :as => :set_status_user
249 get "/user/:display_name/delete" => "users#delete", :as => :delete_user
252 match "/users" => "users#index", :via => [:get, :post]
253 match "/users/:status" => "users#index", :via => [:get, :post]
256 get "/search" => "geocoder#search"
257 get "/geocoder/search_latlon" => "geocoder#search_latlon"
258 get "/geocoder/search_ca_postcode" => "geocoder#search_ca_postcode"
259 get "/geocoder/search_osm_nominatim" => "geocoder#search_osm_nominatim"
260 get "/geocoder/search_geonames" => "geocoder#search_geonames"
261 get "/geocoder/search_osm_nominatim_reverse" => "geocoder#search_osm_nominatim_reverse"
262 get "/geocoder/search_geonames_reverse" => "geocoder#search_geonames_reverse"
265 get "/directions" => "directions#search"
268 post "/export/finish" => "export#finish"
269 get "/export/embed" => "export#embed"
272 resources :messages, :only => [:create, :show, :destroy] do
274 match :reply, :via => [:get, :post]
280 get "/user/:display_name/inbox", :to => redirect(:path => "/messages/inbox")
281 get "/user/:display_name/outbox", :to => redirect(:path => "/messages/outbox")
282 get "/message/new/:display_name" => "messages#new", :as => "new_message"
283 get "/message/read/:message_id", :to => redirect(:path => "/messages/%{message_id}")
285 # oauth admin pages (i.e: for setting up new clients, etc...)
286 scope "/user/:display_name" do
287 resources :oauth_clients
289 match "/oauth/revoke" => "oauth#revoke", :via => [:get, :post]
290 match "/oauth/authorize" => "oauth#authorize", :via => [:get, :post], :as => :authorize
291 get "/oauth/token" => "oauth#token", :as => :token
292 match "/oauth/request_token" => "oauth#request_token", :via => [:get, :post], :as => :request_token
293 match "/oauth/access_token" => "oauth#access_token", :via => [:get, :post], :as => :access_token
294 get "/oauth/test_request" => "oauth#test_request", :as => :test_request
296 # roles and banning pages
297 post "/user/:display_name/role/:role/grant" => "user_roles#grant", :as => "grant_role"
298 post "/user/:display_name/role/:role/revoke" => "user_roles#revoke", :as => "revoke_role"
299 get "/user/:display_name/blocks" => "user_blocks#blocks_on"
300 get "/user/:display_name/blocks_by" => "user_blocks#blocks_by"
301 get "/blocks/new/:display_name" => "user_blocks#new", :as => "new_user_block"
302 resources :user_blocks
303 match "/blocks/:id/revoke" => "user_blocks#revoke", :via => [:get, :post], :as => "revoke_user_block"
307 resources :comments, :controller => :issue_comments
319 resources :redactions
322 match "/403", :to => "errors#forbidden", :via => :all
323 match "/404", :to => "errors#not_found", :via => :all
324 match "/500", :to => "errors#internal_server_error", :via => :all