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 dbdea24290 website: remove .git suffix for go import
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
2021-10-18 17:48:13 +02:00

24 lines
605 B
JavaScript

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