refactor: request thread safety context
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
require "../lib/controller.cr"
|
||||
|
||||
module App::Controllers::Ping
|
||||
class Get < App::Lib::BaseController
|
||||
def call(env)
|
||||
response = {"data" => "pong"}
|
||||
response.to_json
|
||||
module App::Controllers
|
||||
class PingController < App::Lib::BaseController
|
||||
def initialize(@env : HTTP::Server::Context)
|
||||
super(@env)
|
||||
end
|
||||
|
||||
def ping
|
||||
render_json({data: "pong"})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user