3

I want to export Kue-api ( hosted on localhost:3001 ) and access it via node-express ( hosted on localhost:3000 ). But it is blocked because of CORS . In a typical node app , CORS can be disabled like this.

 var cors = require('cors');
    app.use(cors());

But kue in tern uses express and app is not exposed. So question is how to disable CORS in Kue

I tried this

 //----- kue-app.js-----
    var webApp = express();
    var cors = require('cors');
    webApp.use(kue.app);
    webApp.use(kue.app.cros());
    webApp.listen(3001);
Glen Selle
  • 3,966
  • 4
  • 37
  • 59
rajesk
  • 1,407
  • 1
  • 9
  • 8
  • 1
    You have CORS backwards. The Same Origin policy blocks cross origin communication by default. CORS turns it off. – Quentin Dec 26 '15 at 14:50

1 Answers1

2

Solved - like this

    var webApp = express();
    var cors = require('cors');
    webApp.use(cors());
    webApp.use(kue.app);
    webApp.listen();
rajesk
  • 1,407
  • 1
  • 9
  • 8