(req, res, next)
| 28 | } |
| 29 | |
| 30 | async function checkRequest(req, res, next) { |
| 31 | const signature = req.get('x-async-signature'); |
| 32 | |
| 33 | if (!verifySignature(signature)) { |
| 34 | res.status(201).json({ |
| 35 | error: 'You do not have permission 2', |
| 36 | }); |
| 37 | return; |
| 38 | } |
| 39 | |
| 40 | next(); |
| 41 | } |
| 42 | |
| 43 | export default function api(server: express.Express) { |
| 44 | server.use('/api/v1/to-api-server/public', checkRequest, publicApi, handleError); |
nothing calls this directly
no test coverage detected