Add public OBS overlay modes, themes and token protection
This commit is contained in:
10
server.js
10
server.js
@@ -268,6 +268,16 @@ app.post("/api/export/pdf", (req, res) => {
|
||||
}
|
||||
});
|
||||
|
||||
const PUBLIC_OVERLAY_TOKEN = String(process.env.PUBLIC_OVERLAY_TOKEN || "").trim();
|
||||
|
||||
app.get(["/public-overlay", "/public-overlay/:mode"], (req, res) => {
|
||||
if (PUBLIC_OVERLAY_TOKEN && String(req.query.token || "").trim() !== PUBLIC_OVERLAY_TOKEN) {
|
||||
res.status(403).type("text/plain").send("Forbidden");
|
||||
return;
|
||||
}
|
||||
res.sendFile(path.join(__dirname, "index.html"));
|
||||
});
|
||||
|
||||
app.use(
|
||||
express.static(__dirname, {
|
||||
setHeaders: (res, filePath) => {
|
||||
|
||||
Reference in New Issue
Block a user