website/.netlify/edge-functions/go-get.js
pixiake ded18d0729 update go module policy
Signed-off-by: pixiake <guofeng@yunify.com>
2022-12-27 15:27:15 +08:00

17 lines
641 B
JavaScript
Executable File

export default async (request, context) => {
const url = new URL(request.url)
// Look for the query parameter, and return if we don't find it
if (url.searchParams.get('go-get') == '1') {
return new Response(`
<html>
<head>
<meta name="go-import" content="${url.host}${url.pathname} git https://github.com/kubesphere${url.pathname}">
<meta name="go-source" content="${url.host}${url.pathname} https://github.com/kubesphere${url.pathname} https://github.com/kubesphere${url.pathname}/tree/master/{/dir} https://github.com/kubesphere${url.pathname}/blob/master/{/dir}/{/file}#L{/line}">
</head>
</html>`)
}
return
}