You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's a deployed [grape-on-rack on Heroku](http://grape-on-rack.herokuapp.com/).
26
-
27
9
Run
28
10
---
29
11
@@ -37,50 +19,220 @@ Loading NewRelic in developer mode ...
37
19
[2013-06-20 08:57:58] INFO WEBrick::HTTPServer#start: pid=247 port=9292
38
20
```
39
21
40
-
### Hello World
22
+
List Routes
23
+
-----------
24
+
25
+
```
26
+
rake routes
27
+
```
41
28
42
-
Navigate to http://localhost:9292/api/ping with a browser or use `curl`.
29
+
Explore the API
30
+
---------------
31
+
32
+
Explore the API using [Swagger UI](http://petstore.swagger.io). Run the application and point the explorer to `http://localhost:9292/api/swagger_doc` or `http://grape-on-rack.herokuapp.com/api/swagger_doc`.
33
+
34
+
35
+
## Examples
36
+
### [ping](api/ping.rb)
37
+
38
+
A hello world example that returns a JSON document.
An example of using [grape-entity](https://github.com/ruby-grape/grape-entity).
75
215
76
216
```
77
-
rake routes
217
+
$ curl http://localhost:9292/api/entities/1
218
+
219
+
{"tool":{"id":"1","length":10,"weight":"20kg"}}
78
220
```
79
221
80
-
Explore the API
81
-
---------------
222
+
### [headers](api/headers.rb)
82
223
83
-
Explore the API using [Swagger UI](http://petstore.swagger.io). Run the application and point the explorer to `http://localhost:9292/api/swagger_doc` or `http://grape-on-rack.herokuapp.com/api/swagger_doc`.
224
+
Demonstrates header case-sensitive handling.
225
+
226
+
```
227
+
$ curl http://localhost:9292/api/headers/Host
228
+
229
+
{"Host":"localhost:9292"}
230
+
```
231
+
232
+
See Also
233
+
--------
234
+
235
+
There's a deployed [grape-on-rack on Heroku](http://grape-on-rack.herokuapp.com/).
0 commit comments