Websites/config/routes/yiff_rocks_routes.rb
2024-05-02 22:04:43 -05:00

26 lines
828 B
Ruby

# 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