Created
September 15, 2015 17:38
-
-
Save monteslu/b05bc06b6a90bdf22a35 to your computer and use it in GitHub Desktop.
hapi cors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
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