- 
      
- 
        Save samrocksc/ba77e15ac971e91831dc to your computer and use it in GitHub Desktop. 
    hapi cors
  
        
  
    
      This file contains hidden or 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
  
            
or you can just npm install --save hapi-cors-headers