2021-10-18 16:37:10 +01:00
|
|
|
const gitHubNamespace = "goauthentik";
|
2021-10-12 09:58:02 +01:00
|
|
|
|
|
|
|
exports.handler = async function (event, context) {
|
|
|
|
let repo = "";
|
2022-03-03 09:32:18 +00:00
|
|
|
if (event.path === "/") {
|
|
|
|
repo = "/authentik";
|
|
|
|
} else if (event.path.startsWith("/api")) {
|
|
|
|
repo = "/client-go";
|
|
|
|
} else {
|
|
|
|
repo = event.path;
|
2021-10-12 09:58:02 +01:00
|
|
|
}
|
|
|
|
return {
|
|
|
|
statusCode: 200,
|
|
|
|
headers: {
|
|
|
|
"content-type": "text/html",
|
|
|
|
},
|
2022-05-09 20:22:41 +01:00
|
|
|
body: `<meta name="go-import" content="${event.headers.host}${event.path} git https://github.com/${gitHubNamespace}${repo}">`,
|
2021-10-12 09:58:02 +01:00
|
|
|
};
|
2022-05-09 20:22:41 +01:00
|
|
|
};
|