website: fix go-get function (always fallback to authentik repo except hardcoded values) (#5767)
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
parent
a8067c1f0d
commit
60e911baf8
|
@ -2,18 +2,18 @@ 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";
|
||||
if (event.path.startsWith("/api")) {
|
||||
repo = "client-go";
|
||||
} else if (event.path.startsWith("/terraform-provider-authentik")) {
|
||||
repo = "terraform-provider-authentik";
|
||||
} else {
|
||||
repo = event.path;
|
||||
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}">`,
|
||||
body: `<meta name="go-import" content="${event.headers.host}${event.path} git https://github.com/${gitHubNamespace}/${repo}">`,
|
||||
};
|
||||
};
|
||||
|
|
Reference in New Issue