refactor: rename src folder with app

This commit is contained in:
Juan Rodriguez
2024-05-13 08:11:07 +02:00
parent e4ae0c2ac4
commit 9564559610
15 changed files with 26 additions and 12 deletions
+23
View File
@@ -0,0 +1,23 @@
require "./controllers/**"
module App
before_all do |env|
env.response.content_type = "application/json"
end
get "/api/ping" do |env|
Controllers::Ping::Get.new.call(env)
end
get "/:slug" do |env|
Controllers::Link::Index.new.call(env)
end
get "/api/links/:id" do |env|
Controllers::Link::Get.new.call(env)
end
post "/api/links" do |env|
Controllers::Link::Create.new.call(env)
end
end