hapi cors
{
method: 'POST',
path: '/dostuff',
config: {
auth: false,
cors: {
additionalHeaders: ['accept']
},
handler: handleStuff
}
},
// For preflight options requests
{
method: 'OPTIONS',
path: '/{p*}',
config: {
auth: false,
cors: true,
handler: function (request, reply) {
return reply('hi')
}
}
}