切换为 goja
This commit is contained in:
10
examples/kv/index.js
Normal file
10
examples/kv/index.js
Normal file
@@ -0,0 +1,10 @@
|
||||
var db = kv.repo("self");
|
||||
if(request.path == "put"){
|
||||
data = db.get('key')
|
||||
if(data == undefined){
|
||||
db.set('key','0')
|
||||
}else {
|
||||
db.set('key',(parseInt(data)+1).toString())
|
||||
}
|
||||
}
|
||||
response.write("当前存储的数值为 " + db.get('key'))
|
||||
Reference in New Issue
Block a user