Use a custom header for branches

This commit is contained in:
Aditya Thakral 2021-08-25 00:06:19 -04:00
parent 6082683996
commit 22870cf023
1 changed files with 2 additions and 1 deletions

View File

@ -15,6 +15,7 @@ const base64 = Buffer.from(
app.post("/", (req, res) => {
const header = req.header("authorization");
const branch = req.header("x-branch");
if (header == null) {
res.status(403).send("Authorization header is needed");
@ -38,7 +39,7 @@ app.post("/", (req, res) => {
return;
}
res.send(updateWebsite("main"));
res.send(updateWebsite(branch ?? "main"));
});
app.listen(PORT, () => {