@fabrix/spool-hapi
Version:
Spool - Hapi.js. This spool binds the routes compiled in spool-router to a Hapi Server.
17 lines (16 loc) • 514 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const joi = require("joi");
const schemas_1 = require("./schemas");
exports.Validator = {
validateWebConfig(config) {
return new Promise((resolve, reject) => {
joi.validate(config, schemas_1.webConfig, (err, value) => {
if (err) {
return reject(new TypeError('config.web: ' + err));
}
return resolve(value);
});
});
}
};