diff --git a/app/controllers/public/resources_controller.rb b/app/controllers/public/resources_controller.rb index b9dbce3..7ad8ee8 100644 --- a/app/controllers/public/resources_controller.rb +++ b/app/controllers/public/resources_controller.rb @@ -1,7 +1,12 @@ class Public::ResourcesController < Api::ResourcesController # Actions prepend_before_action :set_project, only: [:create, :update] - prepend_before_action :set_resource, only: [:show, :destroy, :update] + prepend_before_action :set_resource, only: [:show, :destroy, :update, :manifest] + + def manifest + resource = Resource.find(params[:id]) + render json: JSON.parse(resource.manifest) + end protected diff --git a/config/routes.rb b/config/routes.rb index c04ab82..f2eebe6 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -14,7 +14,11 @@ end namespace :public do - resources :resources, only: [:create, :show, :destroy, :update] + resources :resources, only: [:create, :show, :destroy, :update] do + member do + get :manifest + end + end end # Default route for static front-end