1 OpenStreetMap::Application.routes.draw do
3 get "api/capabilities" => "api#capabilities"
6 get "capabilities" => "api#capabilities"
7 get "permissions" => "api#permissions"
9 put "changeset/create" => "changeset#create"
10 post "changeset/:id/upload" => "changeset#upload", :id => /\d+/
11 get "changeset/:id/download" => "changeset#download", :as => :changeset_download, :id => /\d+/
12 post "changeset/:id/expand_bbox" => "changeset#expand_bbox", :id => /\d+/
13 get "changeset/:id" => "changeset#read", :as => :changeset_read, :id => /\d+/
14 post "changeset/:id/subscribe" => "changeset#subscribe", :as => :changeset_subscribe, :id => /\d+/
15 post "changeset/:id/unsubscribe" => "changeset#unsubscribe", :as => :changeset_unsubscribe, :id => /\d+/
16 put "changeset/:id" => "changeset#update", :id => /\d+/
17 put "changeset/:id/close" => "changeset#close", :id => /\d+/
18 get "changesets" => "changeset#query"
19 post "changeset/:id/comment" => "changeset#comment", :as => :changeset_comment, :id => /\d+/
20 post "changeset/comment/:id/hide" => "changeset#hide_comment", :as => :changeset_comment_hide, :id => /\d+/
21 post "changeset/comment/:id/unhide" => "changeset#unhide_comment", :as => :changeset_comment_unhide, :id => /\d+/
23 put "node/create" => "node#create"
24 get "node/:id/ways" => "way#ways_for_node", :id => /\d+/
25 get "node/:id/relations" => "relation#relations_for_node", :id => /\d+/
26 get "node/:id/history" => "old_node#history", :id => /\d+/
27 post "node/:id/:version/redact" => "old_node#redact", :version => /\d+/, :id => /\d+/
28 get "node/:id/:version" => "old_node#version", :id => /\d+/, :version => /\d+/
29 get "node/:id" => "node#read", :id => /\d+/
30 put "node/:id" => "node#update", :id => /\d+/
31 delete "node/:id" => "node#delete", :id => /\d+/
32 get "nodes" => "node#nodes"
34 put "way/create" => "way#create"
35 get "way/:id/history" => "old_way#history", :id => /\d+/
36 get "way/:id/full" => "way#full", :id => /\d+/
37 get "way/:id/relations" => "relation#relations_for_way", :id => /\d+/
38 post "way/:id/:version/redact" => "old_way#redact", :version => /\d+/, :id => /\d+/
39 get "way/:id/:version" => "old_way#version", :id => /\d+/, :version => /\d+/
40 get "way/:id" => "way#read", :id => /\d+/
41 put "way/:id" => "way#update", :id => /\d+/
42 delete "way/:id" => "way#delete", :id => /\d+/
43 get "ways" => "way#ways"
45 put "relation/create" => "relation#create"
46 get "relation/:id/relations" => "relation#relations_for_relation", :id => /\d+/
47 get "relation/:id/history" => "old_relation#history", :id => /\d+/
48 get "relation/:id/full" => "relation#full", :id => /\d+/
49 post "relation/:id/:version/redact" => "old_relation#redact", :version => /\d+/, :id => /\d+/
50 get "relation/:id/:version" => "old_relation#version", :id => /\d+/, :version => /\d+/
51 get "relation/:id" => "relation#read", :id => /\d+/
52 put "relation/:id" => "relation#update", :id => /\d+/
53 delete "relation/:id" => "relation#delete", :id => /\d+/
54 get "relations" => "relation#relations"
56 get "map" => "api#map"
58 get "trackpoints" => "api#trackpoints"
60 get "changes" => "api#changes"
62 get "search" => "search#search_all", :as => "api_search"
63 get "ways/search" => "search#search_ways"
64 get "relations/search" => "search#search_relations"
65 get "nodes/search" => "search#search_nodes"
67 get "user/:id" => "users#api_read", :id => /\d+/
68 get "user/details" => "users#api_details"
69 get "user/gpx_files" => "users#api_gpx_files"
70 get "users" => "users#api_users", :as => :api_users
72 get "user/preferences" => "user_preferences#read"
73 get "user/preferences/:preference_key" => "user_preferences#read_one"
74 put "user/preferences" => "user_preferences#update"
75 put "user/preferences/:preference_key" => "user_preferences#update_one"
76 delete "user/preferences/:preference_key" => "user_preferences#delete_one"
78 post "gpx/create" => "traces#api_create"
79 get "gpx/:id" => "traces#api_read", :id => /\d+/
80 put "gpx/:id" => "traces#api_update", :id => /\d+/
81 delete "gpx/:id" => "traces#api_delete", :id => /\d+/
82 get "gpx/:id/details" => "traces#api_read", :id => /\d+/
83 get "gpx/:id/data" => "traces#api_data"
85 # AMF (ActionScript) API
86 post "amf/read" => "amf#amf_read"
87 post "amf/write" => "amf#amf_write"
88 get "swf/trackpoints" => "swf#trackpoints"
91 resources :notes, :except => [:new, :edit, :update], :constraints => { :id => /\d+/ }, :defaults => { :format => "xml" } do
94 get "feed", :defaults => { :format => "rss" }
104 post "notes/addPOIexec" => "notes#create"
105 post "notes/closePOIexec" => "notes#close"
106 post "notes/editPOIexec" => "notes#comment"
107 get "notes/getGPX" => "notes#index", :format => "gpx"
108 get "notes/getRSSfeed" => "notes#feed", :format => "rss"
112 get "/way/:id" => "browse#way", :id => /\d+/, :as => :way
113 get "/way/:id/history" => "browse#way_history", :id => /\d+/
114 get "/node/:id" => "browse#node", :id => /\d+/, :as => :node
115 get "/node/:id/history" => "browse#node_history", :id => /\d+/
116 get "/relation/:id" => "browse#relation", :id => /\d+/, :as => :relation
117 get "/relation/:id/history" => "browse#relation_history", :id => /\d+/
118 get "/changeset/:id" => "browse#changeset", :as => :changeset, :id => /\d+/
119 get "/changeset/:id/comments/feed" => "changeset#comments_feed", :as => :changeset_comments_feed, :id => /\d*/, :defaults => { :format => "rss" }
120 get "/note/:id" => "browse#note", :id => /\d+/, :as => "browse_note"
121 get "/note/new" => "browse#new_note"
122 get "/user/:display_name/history" => "changeset#index"
123 get "/user/:display_name/history/feed" => "changeset#feed", :defaults => { :format => :atom }
124 get "/user/:display_name/notes" => "notes#mine"
125 get "/history/friends" => "changeset#index", :friends => true, :as => "friend_changesets", :defaults => { :format => :html }
126 get "/history/nearby" => "changeset#index", :nearby => true, :as => "nearby_changesets", :defaults => { :format => :html }
128 get "/browse/way/:id", :to => redirect(:path => "/way/%{id}")
129 get "/browse/way/:id/history", :to => redirect(:path => "/way/%{id}/history")
130 get "/browse/node/:id", :to => redirect(:path => "/node/%{id}")
131 get "/browse/node/:id/history", :to => redirect(:path => "/node/%{id}/history")
132 get "/browse/relation/:id", :to => redirect(:path => "/relation/%{id}")
133 get "/browse/relation/:id/history", :to => redirect(:path => "/relation/%{id}/history")
134 get "/browse/changeset/:id", :to => redirect(:path => "/changeset/%{id}")
135 get "/browse/note/:id", :to => redirect(:path => "/note/%{id}")
136 get "/user/:display_name/edits", :to => redirect(:path => "/user/%{display_name}/history")
137 get "/user/:display_name/edits/feed", :to => redirect(:path => "/user/%{display_name}/history/feed")
138 get "/browse/friends", :to => redirect(:path => "/history/friends")
139 get "/browse/nearby", :to => redirect(:path => "/history/nearby")
140 get "/browse/changesets/feed", :to => redirect(:path => "/history/feed")
141 get "/browse/changesets", :to => redirect(:path => "/history")
142 get "/browse", :to => redirect(:path => "/history")
145 root :to => "site#index", :via => [:get, :post]
146 get "/edit" => "site#edit"
147 get "/copyright/:copyright_locale" => "site#copyright"
148 get "/copyright" => "site#copyright"
149 get "/welcome" => "site#welcome"
150 get "/fixthemap" => "site#fixthemap"
151 get "/help" => "site#help"
152 get "/about" => "site#about"
153 get "/history" => "changeset#index"
154 get "/history/feed" => "changeset#feed", :defaults => { :format => :atom }
155 get "/history/comments/feed" => "changeset#comments_feed", :as => :changesets_comments_feed, :defaults => { :format => "rss" }
156 get "/export" => "site#export"
157 match "/login" => "users#login", :via => [:get, :post]
158 match "/logout" => "users#logout", :via => [:get, :post]
159 get "/offline" => "site#offline"
160 get "/key" => "site#key"
161 get "/id" => "site#id"
162 get "/query" => "browse#query"
163 get "/user/new" => "users#new"
164 post "/user/new" => "users#create"
165 get "/user/terms" => "users#terms"
166 post "/user/save" => "users#save"
167 get "/user/:display_name/confirm/resend" => "users#confirm_resend"
168 match "/user/:display_name/confirm" => "users#confirm", :via => [:get, :post]
169 match "/user/confirm" => "users#confirm", :via => [:get, :post]
170 match "/user/confirm-email" => "users#confirm_email", :via => [:get, :post]
171 post "/user/go_public" => "users#go_public"
172 match "/user/reset-password" => "users#reset_password", :via => [:get, :post]
173 match "/user/forgot-password" => "users#lost_password", :via => [:get, :post]
174 get "/user/suspended" => "users#suspended"
176 get "/index.html", :to => redirect(:path => "/")
177 get "/create-account.html", :to => redirect(:path => "/user/new")
178 get "/forgot-password.html", :to => redirect(:path => "/user/forgot-password")
181 get "/auth/failure" => "users#auth_failure"
182 match "/auth/:provider/callback" => "users#auth_success", :via => [:get, :post], :as => :auth_success
183 match "/auth/:provider" => "users#auth", :via => [:get, :post], :as => :auth
186 get "/go/:code" => "site#permalink", :code => /[a-zA-Z0-9_@~]+[=-]*/
189 post "/preview/:type" => "site#preview", :as => :preview
192 resources :traces, :except => [:show]
193 get "/user/:display_name/traces/tag/:tag/page/:page" => "traces#index", :page => /[1-9][0-9]*/
194 get "/user/:display_name/traces/tag/:tag" => "traces#index"
195 get "/user/:display_name/traces/page/:page" => "traces#index", :page => /[1-9][0-9]*/
196 get "/user/:display_name/traces" => "traces#index"
197 get "/user/:display_name/traces/tag/:tag/rss" => "traces#georss", :defaults => { :format => :rss }
198 get "/user/:display_name/traces/rss" => "traces#georss", :defaults => { :format => :rss }
199 get "/user/:display_name/traces/:id" => "traces#show"
200 get "/user/:display_name/traces/:id/picture" => "traces#picture"
201 get "/user/:display_name/traces/:id/icon" => "traces#icon"
202 get "/traces/tag/:tag/page/:page" => "traces#index", :page => /[1-9][0-9]*/
203 get "/traces/tag/:tag" => "traces#index"
204 get "/traces/page/:page" => "traces#index", :page => /[1-9][0-9]*/
205 get "/traces/tag/:tag/rss" => "traces#georss", :defaults => { :format => :rss }
206 get "/traces/rss" => "traces#georss", :defaults => { :format => :rss }
207 get "/traces/mine/tag/:tag/page/:page" => "traces#mine", :page => /[1-9][0-9]*/
208 get "/traces/mine/tag/:tag" => "traces#mine"
209 get "/traces/mine/page/:page" => "traces#mine"
210 get "/traces/mine" => "traces#mine"
211 get "/trace/create", :to => redirect(:path => "/traces/new")
212 get "/trace/:id/data" => "traces#data", :id => /\d+/, :as => "trace_data"
213 get "/trace/:id/edit", :to => redirect(:path => "/traces/%{id}/edit")
214 post "/trace/:id/delete" => "traces#delete", :id => /\d+/
217 match "/diary/new" => "diary_entry#new", :via => [:get, :post]
218 get "/diary/friends" => "diary_entry#index", :friends => true, :as => "friend_diaries"
219 get "/diary/nearby" => "diary_entry#index", :nearby => true, :as => "nearby_diaries"
220 get "/user/:display_name/diary/rss" => "diary_entry#rss", :defaults => { :format => :rss }
221 get "/diary/:language/rss" => "diary_entry#rss", :defaults => { :format => :rss }
222 get "/diary/rss" => "diary_entry#rss", :defaults => { :format => :rss }
223 get "/user/:display_name/diary/comments/:page" => "diary_entry#comments", :page => /[1-9][0-9]*/
224 get "/user/:display_name/diary/comments/" => "diary_entry#comments"
225 get "/user/:display_name/diary" => "diary_entry#index"
226 get "/diary/:language" => "diary_entry#index"
227 get "/diary" => "diary_entry#index"
228 get "/user/:display_name/diary/:id" => "diary_entry#show", :id => /\d+/, :as => :diary_entry
229 post "/user/:display_name/diary/:id/newcomment" => "diary_entry#comment", :id => /\d+/
230 match "/user/:display_name/diary/:id/edit" => "diary_entry#edit", :via => [:get, :post], :id => /\d+/
231 post "/user/:display_name/diary/:id/hide" => "diary_entry#hide", :id => /\d+/, :as => :hide_diary_entry
232 post "/user/:display_name/diary/:id/hidecomment/:comment" => "diary_entry#hidecomment", :id => /\d+/, :comment => /\d+/, :as => :hide_diary_comment
233 post "/user/:display_name/diary/:id/subscribe" => "diary_entry#subscribe", :as => :diary_entry_subscribe, :id => /\d+/
234 post "/user/:display_name/diary/:id/unsubscribe" => "diary_entry#unsubscribe", :as => :diary_entry_unsubscribe, :id => /\d+/
237 get "/user/:display_name" => "users#show", :as => "user"
238 match "/user/:display_name/make_friend" => "users#make_friend", :via => [:get, :post], :as => "make_friend"
239 match "/user/:display_name/remove_friend" => "users#remove_friend", :via => [:get, :post], :as => "remove_friend"
240 match "/user/:display_name/account" => "users#account", :via => [:get, :post]
241 get "/user/:display_name/set_status" => "users#set_status", :as => :set_status_user
242 get "/user/:display_name/delete" => "users#delete", :as => :delete_user
245 match "/users" => "users#index", :via => [:get, :post]
246 match "/users/:status" => "users#index", :via => [:get, :post]
249 get "/search" => "geocoder#search"
250 get "/geocoder/search_latlon" => "geocoder#search_latlon"
251 get "/geocoder/search_ca_postcode" => "geocoder#search_ca_postcode"
252 get "/geocoder/search_osm_nominatim" => "geocoder#search_osm_nominatim"
253 get "/geocoder/search_geonames" => "geocoder#search_geonames"
254 get "/geocoder/search_osm_nominatim_reverse" => "geocoder#search_osm_nominatim_reverse"
255 get "/geocoder/search_geonames_reverse" => "geocoder#search_geonames_reverse"
258 get "/directions" => "directions#search"
261 post "/export/finish" => "export#finish"
262 get "/export/embed" => "export#embed"
265 resources :messages, :only => [:create, :show, :destroy] do
267 match :reply, :via => [:get, :post]
273 get "/user/:display_name/inbox", :to => redirect(:path => "/messages/inbox")
274 get "/user/:display_name/outbox", :to => redirect(:path => "/messages/outbox")
275 get "/message/new/:display_name" => "messages#new", :as => "new_message"
276 get "/message/read/:message_id", :to => redirect(:path => "/messages/%{message_id}")
278 # oauth admin pages (i.e: for setting up new clients, etc...)
279 scope "/user/:display_name" do
280 resources :oauth_clients
282 match "/oauth/revoke" => "oauth#revoke", :via => [:get, :post]
283 match "/oauth/authorize" => "oauth#authorize", :via => [:get, :post], :as => :authorize
284 get "/oauth/token" => "oauth#token", :as => :token
285 match "/oauth/request_token" => "oauth#request_token", :via => [:get, :post], :as => :request_token
286 match "/oauth/access_token" => "oauth#access_token", :via => [:get, :post], :as => :access_token
287 get "/oauth/test_request" => "oauth#test_request", :as => :test_request
289 # roles and banning pages
290 post "/user/:display_name/role/:role/grant" => "user_roles#grant", :as => "grant_role"
291 post "/user/:display_name/role/:role/revoke" => "user_roles#revoke", :as => "revoke_role"
292 get "/user/:display_name/blocks" => "user_blocks#blocks_on"
293 get "/user/:display_name/blocks_by" => "user_blocks#blocks_by"
294 get "/blocks/new/:display_name" => "user_blocks#new", :as => "new_user_block"
295 resources :user_blocks
296 match "/blocks/:id/revoke" => "user_blocks#revoke", :via => [:get, :post], :as => "revoke_user_block"
300 resources :comments, :controller => :issue_comments
312 resources :redactions
315 match "/403", :to => "errors#forbidden", :via => :all
316 match "/404", :to => "errors#not_found", :via => :all
317 match "/500", :to => "errors#internal_server_error", :via => :all