Skip to content

Commit

Permalink
maybe cors this time
Browse files Browse the repository at this point in the history
  • Loading branch information
dinubs committed May 31, 2016
1 parent 287ad94 commit 796d7f0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 2 additions & 4 deletions index.js
Expand Up @@ -9,10 +9,6 @@ server.connection({
routes: {
json: {
space: 4
},
cors: {
origin: ['*'],
additionalHeaders: ['cache-control', 'x-requested-with']
}
}
});
Expand All @@ -28,6 +24,8 @@ server.views({
// Configure routes
var routes = require('./routes')(server);

server.ext('onPreResponse', require('hapi-cors-headers'));

server.start(function (err) {
console.log(err);
console.log('Server running at:', server.info.uri);
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -12,6 +12,7 @@
"boom": "^3.1.1",
"cheerio": "^0.19.0",
"hapi": "^8.8.0",
"hapi-cors-headers": "^1.0.0",
"hapi-locals": "^0.1.5",
"jade": "^1.11.0",
"mongoose": "^4.1.4",
Expand Down

0 comments on commit 796d7f0

Please sign in to comment.