]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/api/versions_controller.rb
Add support for an unversioned 'versions' API call
[rails.git] / app / controllers / api / versions_controller.rb
diff --git a/app/controllers/api/versions_controller.rb b/app/controllers/api/versions_controller.rb
new file mode 100644 (file)
index 0000000..7de3350
--- /dev/null
@@ -0,0 +1,15 @@
+module Api
+  class VersionsController < ApiController
+    authorize_resource :class => false
+
+    around_action :api_call_handle_error, :api_call_timeout
+
+    # Show the list of available API versions. This will replace the global
+    # unversioned capabilities call in due course.
+    # Currently we only support deploying one version at a time, but this will
+    # hopefully change soon.
+    def show
+      @versions = [Settings.api_version]
+    end
+  end
+end