Cloudflare Worker for Go vanity import paths under go.getarcane.app.
The Worker has two jobs:
- return
go-importmetadata when the Go toolchain requests?go-get=1 - redirect browser requests to the matching GitHub repository path
Modules are registered in src/index.ts:
const MODULES: Record<string, VanityModule> = {
arcane: { repoUrl: REPO_URL, subdir: "backend" },
streams: { repoUrl: STREAMS_REPO_URL },
};Use subdir when the Go module lives below the repository root. Omit it for a
module that lives at the root of its own repository.
For example:
go.getarcane.app/arcanemaps tohttps://github.com/getarcaneapp/arcanewith module files inbackend/go.getarcane.app/streamsmaps tohttps://github.com/getarcaneapp/streamsat the repository root
Install dependencies:
bun installRun the Worker locally:
bun run devRun checks:
bun run check
bun run typecheck
bun testDeploy with Wrangler:
bun run deployWorker routing and the TypeScript entrypoint are configured in wrangler.jsonc.
MIT