Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static DB #6

Closed
simonschllng opened this issue Dec 30, 2016 · 5 comments
Closed

Static DB #6

simonschllng opened this issue Dec 30, 2016 · 5 comments

Comments

@simonschllng
Copy link

simonschllng commented Dec 30, 2016

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.

DB Structure Example:
{
	"shortname1": [url1, url2, ...],
	"shortname2": [url3, url4, ...],
	 ...
	 ...
	"shortnameX": [urlZ, ...]
}

Would be nice to be able to set this as plain object.

@roccomuso
Copy link
Owner

roccomuso commented Dec 31, 2016

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.

@simonschllng
Copy link
Author

simonschllng commented Dec 31, 2016 via email

@roccomuso
Copy link
Owner

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.

@eloquence
Copy link
Contributor

@simonschllng If this is still relevant, you may be interested in
#16

@roccomuso
Copy link
Owner

InMemory storage shipped with v1.3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants