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

Is it possible to use on a Relational Database #19

Open
alber70g opened this issue Feb 14, 2017 · 2 comments
Open

Is it possible to use on a Relational Database #19

alber70g opened this issue Feb 14, 2017 · 2 comments
Labels

Comments

@alber70g
Copy link

First a question: is it possible to do this on relational databases as well? For example mysql/maria or postgres?

Next I have some ideas:
I really like the idea of declaring what it should do, instead of writing how it should do it. Especially for writing a light backend for a SPA frontend for example

I've been working on something alike where you define an object on which the request should match and then some optional middleware. It's easier to show it by example:

app.on({ method: 'POST' }, function(req, res, next) { 
  // perform some logic (authorization rules for example)
  next(); // calling next will eventually call the middleware that handles the database
}

This way you define what it should do instead of on which route etc. If you want I can share a very premature draft with you.

@materik
Copy link
Collaborator

materik commented Feb 15, 2017

Sure. that sounds interesting.

For your first question, it should be possible. What you have to do is to write a plugin like restberry-mongoose but instead restberry-mysql or restberry-postgres. You could give it a try if you like :)

@alber70g
Copy link
Author

Have a look at https://github.com/Alber70g/middlerestjs

I haven't been doing much with nodejs, so bear with me. Also this is a very early writedown of what the idea is. I welcome any suggestions. Maybe we can integrate the idea inside restberry, since this project is much more mature

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

No branches or pull requests

2 participants