Skip to content

Instantly share code, notes, and snippets.

@monteslu
Created September 15, 2015 17:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save monteslu/b05bc06b6a90bdf22a35 to your computer and use it in GitHub Desktop.
Save monteslu/b05bc06b6a90bdf22a35 to your computer and use it in GitHub Desktop.
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')
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment