samrocksc
9/15/2015 - 5:39 PM

hapi cors

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')
      }
    }
  }