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.
2021-10-18 15:37:10 +00:00
|
|
|
const gitHubNamespace = "goauthentik";
|
2021-10-12 08:58:02 +00:00
|
|
|
|
|
|
|
exports.handler = async function (event, context) {
|
|
|
|
let repo = "";
|
|
|
|
switch (event.path) {
|
|
|
|
case "/":
|
2021-10-18 15:37:10 +00:00
|
|
|
repo = "/authentik";
|
2021-10-12 08:58:02 +00:00
|
|
|
break;
|
|
|
|
case "/api":
|
2021-10-18 15:37:10 +00:00
|
|
|
repo = "/client-go";
|
2021-10-12 08:58:02 +00:00
|
|
|
break;
|
|
|
|
default:
|
2021-10-18 15:37:10 +00:00
|
|
|
repo = event.path;
|
2021-10-12 08:58:02 +00:00
|
|
|
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}">`
|
|
|
|
};
|
|
|
|
}
|