Got a django dev server running on localhost:8000 and a nodejs server on localhost:3000. I want to import json into the nodejs server but I'm getting this error:
XMLHttpRequest cannot load http://127.0.0.1:8000/api/presentation/?format=json. Origin http://localhost:3000 is not allowed by Access-Control-Allow-Origin
This is my first foray into cross-domain fun so I'm WAY out of my depth.
I've added this to my routes in node (expressjs).
app.all('/', function(req, res){
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "X-Requested-With");
res.render('index', {
title: '...'
});
});
What am I missing / doing wrong?