website: handle go-get requests statically (#5821)

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens L
2023-05-31 12:51:45 +02:00
committed by GitHub
parent 6c03126076
commit 165305fbfe
5 changed files with 55 additions and 27 deletions

View File

@ -1,19 +0,0 @@
const gitHubNamespace = "goauthentik";
exports.handler = async function (event, context) {
let repo = "";
if (event.path.startsWith("/api")) {
repo = "client-go";
} else if (event.path.startsWith("/terraform-provider-authentik")) {
repo = "terraform-provider-authentik";
} else {
repo = "authentik";
}
return {
statusCode: 200,
headers: {
"content-type": "text/html",
},
body: `<meta name="go-import" content="${event.headers.host}${event.path} git https://github.com/${gitHubNamespace}/${repo}">`,
};
};