You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
or I declare, initially, a global variable (for example) then I use in my modelsUndo edits :
global.blogStore = nStore.new("data/blog.db", function() {
app.get('/add',function(req, res){
var model_from_client = JSON.parse(req.param("model", null));
var post = new Post(model_from_client.title, model_from_client.message);
post.save(function(key){
console.log("Post added with key : ", key)
});
});
app.listen(3000);
console.log('Express app started on port 3000');
});
and with :
var Post = function (title, message) {
this.title = title ? title : "";
this.message = message ? message : "";
this.save = function(callback) {
blogStore.save(null,this,function(err, key){
callback(key, err);
});
}
}
thank you
The text was updated successfully, but these errors were encountered:
Hello
I wish I knew what was best if I make an application with Express (for example) :
do I have to, every time I save, do a :
or I declare, initially, a global variable (for example) then I use in my modelsUndo edits :
and with :
thank you
The text was updated successfully, but these errors were encountered: