Websites/config/routes/yiff_rocks_routes.rb

26 lines
828 B
Ruby
Raw Normal View History

2024-05-03 03:04:43 +00:00
# frozen_string_literal: true
module YiffRocksRoutes
DOMAIN = "yiff.rocks"
def self.extended(router)
router.instance_exec do
namespace(:yiff_rocks, path: "") do
constraints(DomainConstraint.new(DOMAIN)) do
namespace(:home, path: "") do
get(:manifest, constraints: { format: "json" })
get(:browserconfig, constraints: { format: "xml" })
get("/:code", action: :show)
post(:create, constraints: { format: "json" }, defaults: { format: :json })
delete("/:code", action: :destroy, constraints: { format: "json" }, defaults: { format: :json })
patch("/:code", action: :update, constraints: { format: "json" }, defaults: { format: :json })
end
root(to: "home#index")
end
end
end
end
end