refactor: rename src folder with app
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user