refactor: request thread safety context

This commit is contained in:
sjdonado
2025-03-18 11:04:50 +01:00
parent b22381cb7f
commit fba2039efc
4 changed files with 126 additions and 100 deletions
+8 -5
View File
@@ -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