Websites/config/routes/yiff_media_routes.rb

32 lines
860 B
Ruby
Raw Normal View History

2024-05-03 03:04:43 +00:00
# frozen_string_literal: true
module YiffMediaRoutes
DOMAIN = "yiff.media"
REPORT = "report"
REPORT_DOMAIN = "#{REPORT}.#{DOMAIN}".freeze
def self.extended(router)
router.instance_exec do
namespace(:yiff_media, path: "") do
constraints(DomainConstraint.new(DOMAIN)) do
namespace(:home, path: "") do
get(:manifest, constraints: { format: "json" })
get(:browserconfig, constraints: { format: "xml" })
end
root(to: "home#index")
end
constraints(DomainConstraint.new(DOMAIN, REPORT)) do
namespace(:reports, path: "") do
get(:manifest, constraints: { format: "json" })
get(:browserconfig, constraints: { format: "xml" })
end
root(to: "reports#index", as: :reports_root)
end
end
end
end
end