]> git.openstreetmap.org Git - rails.git/blobdiff - config/routes.rb
Make api show/update/destroy node actions resourceful
[rails.git] / config / routes.rb
index 75e05d2cad12bbbd58f6c23be8895826abd16ff3..0d6a51ad9f79f279fd039e27db9669f3e9fc4a1c 100644 (file)
@@ -35,11 +35,7 @@ OpenStreetMap::Application.routes.draw do
     get "node/:id/history" => "old_nodes#history", :as => :api_node_history, :id => /\d+/
     post "node/:id/:version/redact" => "old_nodes#redact", :as => :node_version_redact, :version => /\d+/, :id => /\d+/
     get "node/:id/:version" => "old_nodes#show", :as => :api_old_node, :id => /\d+/, :version => /\d+/
-    get "node/:id" => "nodes#show", :as => :api_node, :id => /\d+/
-    put "node/:id" => "nodes#update", :id => /\d+/
-    delete "node/:id" => "nodes#delete", :id => /\d+/
 
-    put "way/create" => "ways#create"
     get "way/:id/history" => "old_ways#history", :as => :api_way_history, :id => /\d+/
     get "way/:id/full" => "ways#full", :as => :way_full, :id => /\d+/
     get "way/:id/relations" => "relations#relations_for_way", :as => :way_relations, :id => /\d+/
@@ -49,7 +45,6 @@ OpenStreetMap::Application.routes.draw do
     put "way/:id" => "ways#update", :id => /\d+/
     delete "way/:id" => "ways#delete", :id => /\d+/
 
-    put "relation/create" => "relations#create"
     get "relation/:id/relations" => "relations#relations_for_relation", :as => :relation_relations, :id => /\d+/
     get "relation/:id/history" => "old_relations#history", :as => :api_relation_history, :id => /\d+/
     get "relation/:id/full" => "relations#full", :as => :relation_full, :id => /\d+/
@@ -62,11 +57,14 @@ OpenStreetMap::Application.routes.draw do
 
   namespace :api, :path => "api/0.6" do
     resources :nodes, :only => [:index, :create]
+    resources :nodes, :path => "node", :id => /\d+/, :only => [:show, :update, :destroy]
     put "node/create" => "nodes#create", :as => nil
 
-    resources :ways, :only => :index
+    resources :ways, :only => [:index, :create]
+    put "way/create" => "ways#create", :as => nil
 
-    resources :relations, :only => :index
+    resources :relations, :only => [:index, :create]
+    put "relation/create" => "relations#create", :as => nil
 
     resource :map, :only => :show