32 lines
860 B
Ruby
32 lines
860 B
Ruby
|
# 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
|