Skip to content

Commit

Permalink
feat: add renderer cdn
Browse files Browse the repository at this point in the history
  • Loading branch information
menduz committed Jul 25, 2021
1 parent f6ec9c1 commit 0ffa37f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/content-url-resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,25 @@ resolvers.push(function resolvePortableExperiencesUrl(asset, options) {
}
})

resolvers.push(function resolvePortableExperiencesUrl(asset, options) {
resolvers.push(function (asset, options) {
if (asset.type == "off-chain" && asset.registry == "unity-renderer-cdn") {
return `https://cdn.decentraland.org/@dcl/unity-renderer/${asset.id}`
}
})

resolvers.push(function (asset, options) {
if (asset.type == "off-chain" && asset.registry == "kernel-cdn") {
return `https://cdn.decentraland.org/@dcl/kernel/${asset.id}`
}
})

resolvers.push(function (asset, options) {
if (asset.type == "off-chain" && asset.registry == "explorer-website-cdn") {
return `https://cdn.decentraland.org/@dcl/explorer-website/${asset.id}`
}
})

resolvers.push(function (asset, options) {
if (asset.type == "off-chain" && asset.registry == "base-avatars") {
const host = defaultWearablesServerForNetwork("ethereum", options)
return `https://${host}/v2/collections/${asset.registry}/wearables/${asset.id}`
Expand Down
12 changes: 12 additions & 0 deletions test/content-url.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ describe("Content url generation", function () {
"urn:decentraland:off-chain:static-portable-experiences:quest-1",
"https://static-pe.decentraland.io/quest-1/mappings"
)
test(
"urn:decentraland:off-chain:unity-renderer-cdn:0.0.0-123123123-badaeafa",
"https://cdn.decentraland.org/@dcl/unity-renderer/0.0.0-123123123-badaeafa"
)
test(
"urn:decentraland:off-chain:kernel-cdn:0.0.0-123123123-badaeafa",
"https://cdn.decentraland.org/@dcl/kernel/0.0.0-123123123-badaeafa"
)
test(
"urn:decentraland:off-chain:explorer-website-cdn:0.0.0-123123123-badaeafa",
"https://cdn.decentraland.org/@dcl/explorer-website/0.0.0-123123123-badaeafa"
)
test(
"urn:decentraland:ethereum:LAND:4763953136893138488487244504044754960247",
"https://peer.decentraland.org/content/entities/scene?pointer=13,-137"
Expand Down

0 comments on commit 0ffa37f

Please sign in to comment.