Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ var async = require('async');
var lodash = require('lodash');
var utils = Prana.utils;
var Storage = require('./storage');
var cors = require('cors');
var chokoVersion = require('../package').version;

// Patch Prana.
Expand Down Expand Up @@ -72,6 +73,11 @@ var Application = module.exports = function(settings) {
cookieParser()
];

// Settings cors middleware.
if (this.settings.cors && this.settings.cors.enabled) {
middlewares.push(cors(this.settings.cors));
}

// Add middlewares to rest and page routers.
middlewares.forEach(function(middleware) {
['rest', 'page'].map(function(routerName) {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"node-uuid": "1.4.x",
"passport": "0.1.x",
"passport-anonymous": "1.0.x",
"cors": "2.4.1",
"passport-http": "0.2.x",
"passport-local": "0.1.x",
"path-to-regexp": "0.1.x",
Expand Down