Beginner question

45 views
Skip to first unread message

Antonio Canela

unread,
Apr 29, 2014, 3:49:56 AM4/29/14
to locomo...@googlegroups.com
Hi, I'm trying to use locomotive to connect to a redis database. I would like to know if it's necessary to use express to do so or not. If true, how could I do something similar to this with locomotive:

app.get('/data.json', function(req, res){
 res.header("Access-Control-Allow-Origin", "*");
 datapoints.updateRT();
 valores=[ {"aData": datapoints.data}] 
 res.contentType('application/json');
 res.send(JSON.stringify(valores[0]));
});

I understand the app variable would be either locomotive or express.

Thank you very much in advance and sorry for my ignorance with this tech.
Reply all
Reply to author
Forward
0 new messages