Guest User

Untitled

a guest
Jul 22nd, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. /*
  2. * host= 192.168.56.3
  3. * port= 5555
  4. * password= secret
  5. */
  6. var redis = require("redis"),
  7. client = redis.createClient({host:"192.168.56.3", "port":5555, "password":"secret"});
  8.  
  9. client.on("error", function (err) {
  10. console.log("Error " + err);
  11. });
  12.  
  13. client.on("ready", function (err) {
  14. // save a string
  15. client.set("a","10");
  16.  
  17. // read a string
  18. client.get("a", function(err, data)
  19. {
  20. console.log(data)
  21. })
  22.  
  23. client.quit()
  24.  
  25. });
Add Comment
Please, Sign In to add comment