Closed marianozunino closed 6 years ago
You can just pass the routes
property with your validate
and failAction
exactly as they appear in your example into the server
object of your Glue manifest:
const manifest = {
server: {
host: 'localhost',
port: 3000,
routes: {
validate: {
failAction: async (request, h, err) => { /*your handler omitted for clarity*/ }
}
}
}
};
const startServer = async function() {
const server = await Glue.compose(manifest);
await server.start();
console.log('Server Started');
};
startServer();
Gotcha. I was trying to keep a JSON file. Now I'm using a Js file, and exporting the object.
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.
Since in hapi 17, all the joi errors return "Invalid payload" I want to implement this "failAction" in server routes config.
How can I implement this failAction with glue?