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 31e62aeCopy full SHA for 31e62ae
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,27 @@
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"
15
get "/json", to: "json.index"
16
get "/updates", to: "updates.index"
- get "/plaintext", to: "plaintext.index"
17
get "/queries", to: "queries.index"
18
+ get "/plaintext", to: ->(env) do
19
20
21
+ 'Server' => 'Hanami',
22
+ 'Content-Type' => 'text/plain',
23
+ 'Date' => Time.now.httpdate
24
25
+ ['Hello, World!']]
26
27
end
28
0 commit comments