-
Notifications
You must be signed in to change notification settings - Fork 570
Node.js example (node redis)
Josh Baker edited this page Feb 21, 2017
·
1 revision
npm install redis
All Tile38 commands should be sent using the client.send_command(name, args, callback)
function.
var redis = require("redis")
var client = redis.createClient(9851, "localhost")
client.send_command(
"SET", ["fleet", "truck1", "POINT", "33", "-115"],
function(err, reply){
if (err){
// ERROR
}else{
console.log(reply)
// OK
}
}
)
client.send_command(
"GET", ["fleet", "truck1"],
function(err, reply){
if (err){
// ERROR
}else{
console.log(reply)
// {"type":"Point","coordinates":[-115,33]}
}
}
)