mirror of
https://github.com/github/codeql.git
synced 2025-12-17 17:23:36 +01:00
13 lines
278 B
JavaScript
13 lines
278 B
JavaScript
import express from 'express';
|
|
import Ajv from 'ajv';
|
|
|
|
let ajv = new Ajv({ allErrors: true });
|
|
ajv.addSchema(require('./input-schema'), 'input');
|
|
|
|
var app = express();
|
|
app.get('/user/:id', function(req, res) {
|
|
if (!ajv.validate('input', req.body)) { // NOT OK
|
|
return;
|
|
}
|
|
});
|