forked from Shobhit1/webApp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcache.js
More file actions
32 lines (27 loc) · 723 Bytes
/
Copy pathcache.js
File metadata and controls
32 lines (27 loc) · 723 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
var mc = require('mc');
// All defaults
var client = undefined
exports.connect = function() {
client = new mc.Client()
// client.port = 11211
// client.host = 'localhost'
client.connect(function() {
console.log("Connected to the memcache on host 1.2.3.4 on port 11211!")
}
)
return client
}
exports.get = function(key, callback) {
// client.setAdapter(mc.Adapter.json)
client.get(key, callback)
}
exports.set = function(key, value) {
console.log("Parekh")
client.set(key, value, { flags: 0, exptime: 0}, function(error, status){
if (!error) {
console.log("Vivek"+status); // 'STORED' on success!
}else{
console.log(JSON.stringify(error))
}
})
};