Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Nickibrochner/7914eb3dcb9de62ecf8a20153b952da4 to your computer and use it in GitHub Desktop.
Save Nickibrochner/7914eb3dcb9de62ecf8a20153b952da4 to your computer and use it in GitHub Desktop.
Getting the drawing
app.get('/chart', function(req, res) {
// Now we can run a script and invoke a callback when complete, e.g.
runScript('/home/nicki/akkredibot/js/drawchart.js', function (err) {
if (err) throw err;
jsonResponse.push(
{text: "Filnavn: "+imagename+""},
{ "attachment": {
"type": "image",
"payload": {
"url": "http://95.85.21.185/" +imagename+ ""}}
}
);
res.send(jsonResponse);
delete require.cache[require.resolve('/home/nicki/akkredibot/js/drawchart')];
jsonResponse.length = 0;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment