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
Verifying my Blockstack ID is secured with the address 179AJ3rxPcjpcCmVVeorEoYEouT51xZJxk https://explorer.blockstack.org/address/179AJ3rxPcjpcCmVVeorEoYEouT51xZJxk |
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
Verifying my Blockstack ID is secured with the address 1C4ux7BhQ81ieNkELZweGdR4TsMiCrsFQo https://explorer.blockstack.org/address/1C4ux7BhQ81ieNkELZweGdR4TsMiCrsFQo |
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
Verifying my Blockstack ID is secured with the address 1C4ux7BhQ81ieNkELZweGdR4TsMiCrsFQo https://explorer.blockstack.org/address/1C4ux7BhQ81ieNkELZweGdR4TsMiCrsFQo |
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
Verifying my Blockstack ID is secured with the address 1Dp8FiNMTg49XwKn4xdqT9RrKLCiFHze5U https://explorer.blockstack.org/address/1Dp8FiNMTg49XwKn4xdqT9RrKLCiFHze5U |
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
// En test af Group | |
app.get('/testaar', function(req, res) { | |
function QueryMongoDB(callback) { | |
MongoClient.connect('mongodb://localhost:27017/Akkredibot', function(err, db) { | |
if (err) throw err | |
// her vælges akkredibot databasen inklusiv query | |
db.collection('akkrdata').aggregate([ | |
{$group: |
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": { |
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
const ChartjsNode = require('chartjs-node'); | |
// 600x600 canvas size | |
var chartNode = new ChartjsNode(600, 600); | |
var randomnumber=Math.random(); | |
var imagename = "testimage"+randomnumber+".png" | |
module.exports = imagename | |
// each api returns a Promise | |
chartNode.drawChart({ | |
type: 'bar', |
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('/test', function(req, res) { | |
var childProcess = require('child_process'); | |
function runScript(scriptPath, callback) { | |
// keep track of whether callback has been invoked to prevent multiple invocations | |
var invoked = false; | |
var process = childProcess.fork(scriptPath); |