Skip to content

Commit 5ab2ece

Browse files
@jotadevelopersergiohgz
authored andcommitted
feat: add audit quick endpoint
1 parent 7c3a6d3 commit 5ab2ece

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

plugins/audit/src/index.js

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,23 @@ export default class ProxyAudit {
4040

4141
return fetchAu;
4242
};
43-
/* eslint new-cap:off */
44-
const router = express.Router();
45-
/* eslint new-cap:off */
46-
router.use(compression());
47-
router.use(bodyParser.json({ strict: false, limit: '50mb' }));
48-
router.post('/audits', (req: $RequestExtend, res: $ResponseExtend) => {
43+
44+
const handleAudit = (req: $RequestExtend, res: $ResponseExtend) => {
4945
if (this.enabled) {
5046
fetchAudit(req, res);
5147
} else {
5248
res.status(500).end();
5349
}
54-
});
50+
};
51+
52+
/* eslint new-cap:off */
53+
const router = express.Router();
54+
/* eslint new-cap:off */
55+
router.use(compression());
56+
router.use(bodyParser.json({ strict: false, limit: '50mb' }));
57+
router.post('/audits', handleAudit);
58+
59+
router.post('/audits/quick', handleAudit);
5560

5661
app.use('/-/npm/v1/security', router);
5762
}

0 commit comments

Comments
 (0)