trailpack-hapi
Version:
Hapi.js Trailpack. This pack binds the routes compiled in trailpack-router to a Hapi Server.
17 lines (12 loc) • 348 B
JavaScript
const joi = require('joi')
const schemas = require('./schemas')
module.exports = {
validateWebConfig (config) {
return new Promise((resolve, reject) => {
joi.validate(config, schemas.webConfig, (err, value) => {
if (err) return reject(new TypeError('config.web: ' + err))
return resolve(value)
})
})
}
}