|
@@ -2,11 +2,27 @@
|
|
|
|
|
|
module HelloWorld
|
|
module HelloWorld
|
|
class Routes < Hanami::Routes
|
|
class Routes < Hanami::Routes
|
|
- get "/json", to: "json.index"
|
|
|
|
|
|
+ get "/json", to: ->(env) do
|
|
|
|
+ [200,
|
|
|
|
+ {
|
|
|
|
+ 'Server' => 'Rails',
|
|
|
|
+ 'Content-Type' => 'application/json',
|
|
|
|
+ 'Date' => Time.now.httpdate,
|
|
|
|
+ },
|
|
|
|
+ [{ 'message' => 'Hello, World!' }.to_json]]
|
|
|
|
+ end
|
|
get "/db", to: "db.index"
|
|
get "/db", to: "db.index"
|
|
get "/queries", to: "queries.index"
|
|
get "/queries", to: "queries.index"
|
|
get "/fortunes", to: "fortunes.index"
|
|
get "/fortunes", to: "fortunes.index"
|
|
get "/updates", to: "updates.index"
|
|
get "/updates", to: "updates.index"
|
|
- get "/plaintext", to: "plaintext.index"
|
|
|
|
|
|
+ get "/plaintext", to: ->(env) do
|
|
|
|
+ [200,
|
|
|
|
+ {
|
|
|
|
+ 'Server' => 'Hanami',
|
|
|
|
+ 'Content-Type' => 'text/plain',
|
|
|
|
+ 'Date' => Time.now.httpdate
|
|
|
|
+ },
|
|
|
|
+ ['Hello, World!']]
|
|
|
|
+ end
|
|
end
|
|
end
|
|
end
|
|
end
|