Closed simonschllng closed 6 years ago
Ok, let's talk about this.
You basically mean adding a new method called webHooks.update(OBJ);
? this can be easily implemented.
Right now you can pass a JSON file with pre-existing content:
var webHooks = new WebHooks({
db: './webHooksDB.json' // json file that store webhook URLs
});
With an update
method you would be able to add a JSON object programmatically to the DB.
What I actually want to do is simply:
var obj = { hooks: [{}, {}] }; // complete config / in memory db
var webHooks = new WebHooks(obj);
I don't want to give a json file at all.
So we're referring to the in-memory storage: #4 . These new persistence methods are under development. But the code should be refactored for this improvements. PR are more than welcome.
@simonschllng If this is still relevant, you may be interested in https://github.com/roccomuso/node-webhooks/pull/16
InMemory storage shipped with v1.3.0
.
I am looking to implement webhook calls. I don't need a dynamic DB so I would not make use of
add
, etc. Therefor it would be great to be able to use a static DB, checked into revision control along the project. What is the json syntax of the current db? Is the syntax stable?EDIT:
Ok, found it. Scrolled down too fast.
Would be nice to be able to set this as plain object.