diff --git a/master.js b/master.js index 49b46cd7..6e1bdaf7 100644 --- a/master.js +++ b/master.js @@ -93,6 +93,13 @@ app.get("/inventory", function(req, res) { res.send(docs); }); }); +// endpoint for getting the chartjs library +app.get("/chart.js", function(req, res) { + res.header("Access-Control-Allow-Origin", "*"); + res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"); + // Check it and send it + res.end(fs.readFileSync("node_modules/chartjs/chart.js")); +}); var server = app.listen(config.masterPort || 8080, function () { console.log("Listening on port %s...", server.address().port); diff --git a/static/index.html b/static/index.html index 084b2e68..ae504e47 100644 --- a/static/index.html +++ b/static/index.html @@ -2,6 +2,7 @@