Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-vanity

Cloudflare Worker for Go vanity import paths under go.getarcane.app.

The Worker has two jobs:

  • return go-import metadata when the Go toolchain requests ?go-get=1
  • redirect browser requests to the matching GitHub repository path

Add A Module

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/arcane maps to https://github.com/getarcaneapp/arcane with module files in backend/
  • go.getarcane.app/streams maps to https://github.com/getarcaneapp/streams at the repository root

Commands

Install dependencies:

bun install

Run the Worker locally:

bun run dev

Run checks:

bun run check
bun run typecheck
bun test

Deploy with Wrangler:

bun run deploy

Configuration

Worker routing and the TypeScript entrypoint are configured in wrangler.jsonc.

License

MIT

About

Vanity import URLs for Go modules on Cloudflare Workers.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages