diff --git a/lib/http/index.js b/lib/http/index.js index a9325ba8..e85c9a75 100755 --- a/lib/http/index.js +++ b/lib/http/index.js @@ -20,7 +20,8 @@ var app = express() , pug = require('pug') , json = require('./routes/json') , util = require('util') - , nib = require('nib'); + , nib = require('nib') + , cors = require('cors'); // expose the app @@ -47,6 +48,7 @@ app.locals = { inspect: util.inspect }; app.use(stylus.middleware({ src: __dirname + '/public', compile: compile })); app.use(express.static(__dirname + '/public')); +app.use('*', cors()); // JSON api diff --git a/package.json b/package.json index 9621ed20..36d4402c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { - "name": "kue", + "name": "kue-cors", "version": "0.11.5", - "description": "Feature rich priority job queue backed by redis", + "description": "Feature rich priority job queue backed by redis with CORS enabled", "homepage": "http://automattic.github.io/kue/", "keywords": [ "job", @@ -15,17 +15,22 @@ { "name": "Behrad Zari", "email": "behradz@gmail.com" + }, + { + "name": "Miguel Angel Flores", + "email": "supermafete@gmail.com" } ], "repository": { "type": "git", - "url": "https://github.com/Automattic/kue.git" + "url": "https://github.com/supermafete/kue-cors" }, "bugs": { - "url": "https://github.com/Automattic/kue/issues" + "url": "https://github.com/supermafete/kue-cors/issues" }, "dependencies": { "body-parser": "^1.12.2", + "cors": "^2.8.4", "express": "^4.12.2", "lodash": "^4.0.0", "nib": "~1.1.2",