business: DocFast deployed on Hetzner CAX11 (167.235.156.214)
This commit is contained in:
parent
37094c8945
commit
a1c86b0ebc
13 changed files with 181 additions and 111 deletions
|
|
@ -1,8 +1,5 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.authMiddleware = authMiddleware;
|
||||
const API_KEYS = new Set((process.env.API_KEYS || "test-key-123").split(",").map((k) => k.trim()));
|
||||
function authMiddleware(req, res, next) {
|
||||
export function authMiddleware(req, res, next) {
|
||||
const header = req.headers.authorization;
|
||||
if (!header?.startsWith("Bearer ")) {
|
||||
res.status(401).json({ error: "Missing API key. Use: Authorization: Bearer <key>" });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue