# 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