5753182e03
* migrate to netlify proxy Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org> * relative forward to func Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org> * custom logic for go paths Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org> * fix const Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org> * missing break Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org> * add default for new repos Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
24 lines
625 B
JavaScript
24 lines
625 B
JavaScript
const gitHubNamespace = "goauthentik.io";
|
|
|
|
exports.handler = async function (event, context) {
|
|
let repo = "";
|
|
switch (event.path) {
|
|
case "/":
|
|
repo = "/authentik.git";
|
|
break;
|
|
case "/api":
|
|
repo = "/client-go.git";
|
|
break;
|
|
default:
|
|
repo = `${event.path}.git`;
|
|
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}">`
|
|
};
|
|
}
|