zeroasterisk / MeteorRider

PhoneGap/Cordova + Meteor integration approach "DOM hijacking", telling PhoneGap where to get content from, letting Meteor hijack your PhoneGap app's HTML/CSS/JS
MIT License
183 stars 28 forks source link

CORS headers and localhost testing #27

Open zeroasterisk opened 10 years ago

zeroasterisk commented 10 years ago

as suggested in #7 by @hiddentao here is a means of getting CORS header into Meteor...

I managed to get the Phonegap dev app connecting to my localhost Meteor app. I got CORS working in Meteor with the following server code:

WebApp.rawConnectHandlers.use("/",
  function(req, res, next) {
    res.setHeader("Access-Control-Allow-Origin", "*");
    next();
  }
);