Skip to content

Commit 83f60d5

Browse files
committed
feat(): support for github url on raw plutus.json endpoint
1 parent 7a50877 commit 83f60d5

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

registry/frontend/app/routes/dapp.$scope.$name.raw.plutus[.]json.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,16 @@ export async function loader({ context, params }: Route.LoaderArgs) {
2424
let output = '{}';
2525

2626
if (result.dapp.blueprintUrl) {
27+
let _finalUrl = result.dapp.blueprintUrl;
28+
29+
if (_finalUrl.includes('github.com')) {
30+
_finalUrl = _finalUrl
31+
.replace('github.com', 'raw.githubusercontent.com')
32+
.replace('/blob', '');
33+
}
34+
2735
// Improve it by storing on cache
28-
const blueprintResult = await fetch(result.dapp.blueprintUrl);
36+
const blueprintResult = await fetch(_finalUrl);
2937

3038
if (blueprintResult.ok) {
3139
output = await blueprintResult.text();

0 commit comments

Comments
 (0)