Management API and tools
This commit is contained in:
parent
f698249dd8
commit
9b81a6cc8b
15 changed files with 222 additions and 149 deletions
10
backend/src/app/middleware/requiresKey.ts
Normal file
10
backend/src/app/middleware/requiresKey.ts
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import { NextFunction, Request, Response } from "express";
|
||||
|
||||
export default () => {
|
||||
return (req: Request, res: Response, next: NextFunction) => {
|
||||
if (!req.query.mgmtKey || req.query.mgmtKey != process.env.MGMT_KEY) {
|
||||
return res.status(403).send(`Key is not authorized`);
|
||||
}
|
||||
return next();
|
||||
};
|
||||
};
|
||||
Loading…
Reference in a new issue