temporarily add SAPI

This commit is contained in:
bee 2022-03-01 19:46:17 -08:00
parent 19f49e4a9d
commit 5622037719
No known key found for this signature in database
GPG key ID: 70EECBF29DA75D8B
9 changed files with 452 additions and 1 deletions

11
SimplyAPI/lib/Validate.js Normal file
View file

@ -0,0 +1,11 @@
const Ajv = require('ajv')
const ajv = new Ajv()
class Validate {
static validateSchema = async (schema, body) => {
const validate = ajv.compile(schema)
return validate(body)
}
}
module.exports = Validate