Skip to content

Commit dbf1548

Browse files
committed
fix(web): release-download proxy points at this repo's GitHub releases
The npm postinstall downloads the platform binary through levelcode.vercel.app/api/releases/download/... which redirected to github.com/yethikrishna/levelcode-community — a repo that doesn't carry our releases, so every fresh install 404'd after publishing. Now defaults to yethikrishna/levelcode/releases with a LEVELCODE_RELEASES_BASE_URL env override for forks.
1 parent f2da930 commit dbf1548

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

  • web/src/app/api/releases/download/[version]/[filename]

‎web/src/app/api/releases/download/[version]/[filename]/route.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ export async function GET(
1818
}
1919

2020
// Current download location - can be changed in the future without affecting old clients
21-
const downloadUrl = `https://github.com/yethikrishna/levelcode-community/releases/download/v${version}/${filename}`
21+
// Env-overridable so forks/self-hosted deploys can repoint without code edits.
22+
// Defaults to this repository's GitHub releases.
23+
const releasesBase =
24+
process.env.LEVELCODE_RELEASES_BASE_URL ||
25+
'https://github.com/yethikrishna/levelcode/releases/download'
26+
const downloadUrl = `${releasesBase}/v${version}/${filename}`
2227

2328
return NextResponse.redirect(downloadUrl, 302)
2429
}

0 commit comments

Comments
 (0)