monsur / enable-cors.org

Advocacy for CORS
http://enable-cors.org/
208 stars 98 forks source link

Add details how to enable on HAPI? #99

Open srl295 opened 9 years ago

srl295 commented 9 years ago

docs says

CORS headers are disabled by default. To enable, set cors to true, or ... [other options]

monsur commented 9 years ago

Do you have a full code sample (or a link to a full code sample)? Can you create a pull request?

srl295 commented 9 years ago

I don't have a full sample yet but this seems to work: server2.route({path:'/x', method: 'GET', config: {cors: true}, handler: function(request,reply){reply.write('Hi');}});