This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
authentik/website/netlify/functions/go-get.js
Jens Langhammer 257ac04be4 website: fix go-get repo
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
2022-03-03 10:32:23 +01:00

20 lines
545 B
JavaScript

const gitHubNamespace = "goauthentik";
exports.handler = async function (event, context) {
let repo = "";
if (event.path === "/") {
repo = "/authentik";
} else if (event.path.startsWith("/api")) {
repo = "/client-go";
} else {
repo = event.path;
}
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}">`
};
}