Created
July 14, 2017 14:01
-
-
Save Nickibrochner/7914eb3dcb9de62ecf8a20153b952da4 to your computer and use it in GitHub Desktop.
Getting the drawing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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