File tree Expand file tree Collapse file tree 3 files changed +18
-29
lines changed Expand file tree Collapse file tree 3 files changed +18
-29
lines changed Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 2
2
3
3
module HelloWorld
4
4
class Routes < Hanami ::Routes
5
- get "/json" , to : "json.index"
5
+ get "/json" , to : -> ( env ) do
6
+ [ 200 ,
7
+ {
8
+ 'Server' => 'Rails' ,
9
+ 'Content-Type' => 'application/json' ,
10
+ 'Date' => Time . now . httpdate ,
11
+ } ,
12
+ [ { 'message' => 'Hello, World!' } . to_json ] ]
13
+ end
6
14
get "/db" , to : "db.index"
7
15
get "/queries" , to : "queries.index"
8
16
get "/fortunes" , to : "fortunes.index"
9
17
get "/updates" , to : "updates.index"
10
- get "/plaintext" , to : "plaintext.index"
18
+ get "/plaintext" , to : -> ( env ) do
19
+ [ 200 ,
20
+ {
21
+ 'Server' => 'Hanami' ,
22
+ 'Content-Type' => 'text/plain' ,
23
+ 'Date' => Time . now . httpdate
24
+ } ,
25
+ [ 'Hello, World!' ] ]
26
+ end
11
27
end
12
28
end
You can’t perform that action at this time.
0 commit comments