MCPcopy Create free account
hub / github.com/cameri/nostream / requireProcessor

Function requireProcessor

src/routes/callbacks/index.ts:12–20  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

10const router: Router = Router()
11
12const requireProcessor = (name: string) =>
13 (_req: Request, res: Response, next: NextFunction) => {
14 const settings = createSettings()
15 if (!settings.payments?.enabled || settings.payments.processor !== name) {
16 res.status(403).send('Forbidden')
17 return
18 }
19 next()
20 }
21
22router
23 .post('/zebedee', requireProcessor('zebedee'), json(), withController(createZebedeeCallbackController))

Callers 1

index.tsFile · 0.85

Calls 1

createSettingsFunction · 0.90

Tested by

no test coverage detected