Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
gy4443
chemotion_eln_server
Commits
e15bece2
Commit
e15bece2
authored
Aug 04, 2015
by
Florian Hübsch
Browse files
Add Sample API, update README.
parent
2b96488d
Changes
3
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
e15bece2
...
...
@@ -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`
app/api/api.rb
View file @
e15bece2
...
...
@@ -4,4 +4,5 @@ class API < Grape::API
formatter
:json
,
Grape
::
Formatter
::
ActiveModelSerializers
mount
Chemotion
::
CollectionAPI
mount
Chemotion
::
SampleAPI
end
app/api/chemotion/sample_api.rb
0 → 100644
View file @
e15bece2
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment