Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to enable CORS ? #1

Closed
vcardins opened this issue Jul 8, 2015 · 2 comments
Closed

How to enable CORS ? #1

vcardins opened this issue Jul 8, 2015 · 2 comments

Comments

@vcardins
Copy link

vcardins commented Jul 8, 2015

First, thanks for this great piece of code !!
I'm not a node.js expert and I'm started my node server in another port, however I'm getting 401 - http://screencast.com/t/aTYKPs5nZ. Could you advice how I could enable CORS? Or is there anything else that I'm missing ? I tried to add

app.use(function(req, res, next) {
  res.header("Access-Control-Allow-Origin", "*");
  res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
  next();
});

but it didn't work.

@vcardins
Copy link
Author

vcardins commented Jul 8, 2015

Never mind, I used this lib: https://github.com/expressjs/cors and it worked fine. Again, Great job !!!

@vcardins vcardins closed this as completed Jul 8, 2015
@paulvanbladel
Copy link
Owner

Hi Victor,
Thanks for the very first comment in this new github repository.
I'm glad you figured out yourself the cors problem.
Cheers
paul.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants