redis_backend.js

Dependencies


API


// set the redis configuration
setRedisConf({ "host" : "127.0.0.1", "port" : "6379", "pwd" : "exampleRedisPWD" });

// operation 1-1 : set key-value pair
setRedisPair("key-1", "val-1", function(data) { console.log(data); });

// operation 1-2 : get value by key
getRedisPair("key-1", function(data) { console.log(data); });

// operation 1-3 : delete value by key
delRedisPair("key-1", function(data) { console.log(data); });

// operation 2 : auto process API
// GET example : 
// |- https://api.com/?s=service1&v=api1
// |- https://api.com/?s=service1&v=api2
// |- https://api.com/?s=service2&v=api1
autoProcessAPI(
  {
    "apiUrl" : "https://api.com/", 
    "apiService" : {
      "service1" : ["api1", "api2"],
      "service2" : ["api1"]
    } 
  }
);

results matching ""

    No results matching ""