Working on adding charts to master GUI

This commit is contained in:
Danielv123 committed 2016-09-30 23:23:01 +02:00
1 parent 379f8398c7
commit 5670bdb77a
4 files changed
+67 -2

No files matched your search

+7
View File
@@ -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);