Commit e15bece2 authored by Florian Hübsch's avatar Florian Hübsch
Browse files

Add Sample API, update README.

parent 2b96488d
......@@ -25,3 +25,7 @@ A user is seeded with email `test@ninjaconcept.com` and password `ninjaconcept`.
* Get serialized collection roots
`/api/v1/collections/roots`
* Get serialized sample by id
`/api/v1/samples/:id`
......@@ -4,4 +4,5 @@ class API < Grape::API
formatter :json, Grape::Formatter::ActiveModelSerializers
mount Chemotion::CollectionAPI
mount Chemotion::SampleAPI
end
module Chemotion
class SampleAPI < Grape::API
resource :samples do
desc "Return serialized sample by id"
params do
requires :id, type: Integer, desc: "Sample id"
end
route_param :id do
get do
Sample.find(params[:id])
end
end
end
end
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment