diff --git a/.gitattributes b/.gitattributes index 1125b70..874188c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,9 @@ * text=auto eol=lf *.png binary *.woff2 binary + +# Classify the repo by its product language (the Go CLI); the Worker/site +# TypeScript otherwise outweighs it in linguist stats. +web/** -linguist-detectable +worker/** -linguist-detectable +shared/** -linguist-detectable diff --git a/worker/index.ts b/worker/index.ts index 37b3b9d..ce99759 100644 --- a/worker/index.ts +++ b/worker/index.ts @@ -128,6 +128,15 @@ export default { async fetch(request, env, executionContext): Promise { const url = new URL(request.url); + // `go install shell.online/cmd/shell@latest` resolves the module by + // requesting any path with ?go-get=1 and reading this meta tag. + if (url.searchParams.get("go-get") === "1") { + return new Response( + '\n', + { headers: { "Content-Type": "text/html; charset=utf-8" } }, + ); + } + if (url.pathname === "/api/health" && request.method === "GET") { return json({ ok: true, service: "shell.online", version: RELEASE_VERSION }); }