We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f7401a5 commit ab904d8Copy full SHA for ab904d8
frameworks/Ruby/hanami/app/actions/json/index.rb
frameworks/Ruby/hanami/app/actions/plaintext/index.rb
frameworks/Ruby/hanami/config/routes.rb
@@ -2,10 +2,26 @@
2
3
module HelloWorld
4
class Routes < Hanami::Routes
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
14
get "/db", to: "db.index"
- get "/json", to: "json.index"
15
get "/updates", to: "updates.index"
- get "/plaintext", to: "plaintext.index"
16
get "/queries", to: "queries.index"
17
+ get "/plaintext", to: ->(env) do
18
19
20
+ 'Server' => 'Hanami',
21
+ 'Content-Type' => 'text/plain',
22
+ 'Date' => Time.now.httpdate
23
24
+ ['Hello, World!']]
25
26
end
27
0 commit comments