Answer the question
In order to leave comments, you need to log in
How to make cross domain requests on node.js?
My project is based on django. But since django is not suitable for realtime functionality, I had to move it to a second backend to node.js. So, the question is how best to make cross-domain requests for it. There is an option to get confused with socket.io, but there may be simpler options with regular http. Maybe this can be somehow solved on nginx/apache? And yes, I would not want to use jsonp.
Answer the question
In order to leave comments, you need to log in
Add headers:
res.setHeader('Access-Control-Allow-Origin', '*');
res.setHeader('Access-Control-Allow-Headers', 'origin, content-type, accept');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question