I am trying to load a csv file using d3.csv, I dont know if the node server is the problem or some other code. But its reading the page html instead of the data into the data object Here is the server:
const server = http.createServer((req, res) => {
res.statusCode = 200;
res.setHeader('Content-Type', 'html');
res.end(fs.readFileSync("index.html"));
});
And here is the relevent d3 code:
d3.csv("./Data/data2.csv").then(function(data) {
// format the data
Where data ends up containing the html code :
Any suggestions as to why ? Thanks