Initial Commit

This commit is contained in:
Shinuwa 2026-06-28 22:44:04 +02:00
commit 6d2e379a0c
41 changed files with 5064 additions and 0 deletions

View file

@ -0,0 +1,18 @@
import { config } from "../../config.js";
function authMiddleware(req, res, next) {
if (!config.webApiKey) {
return next();
}
const header = req.headers.authorization || "";
const token = header.replace("Bearer ", "");
if (token === config.webApiKey) {
return next();
}
return res.status(401).json({ error: "Unauthorized" });
}
export { authMiddleware };