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

API Pagination, Filtering and Relationship #57

Closed
diegoleme opened this issue Mar 28, 2015 · 5 comments
Closed

API Pagination, Filtering and Relationship #57

diegoleme opened this issue Mar 28, 2015 · 5 comments

Comments

@diegoleme
Copy link

What do you think of implementing the standards?

@typicode
Copy link
Owner

typicode commented Apr 1, 2015

That's a very good question.
You can already do pagination, filtering and relationship with JSON Server:

  • Pagination using _start and _end slicing params
  • Basic filtering using prop=someval
  • Relationship up to one degree /posts/1/comments

But all are very basic. Do you need more?

About JSON API spec, I think it's really a great project. However, there are other specs as well, like Swagger.

So, personally for the moment, I prefer to stick with something basic and without too much strong opinions.

But, if you need specifically a JSON API standard, there's https://github.com/fortunejs/fortune which implements it.

Maybe an adapter for lowdb which is the DB behind JSON Server would bring the best of both worlds.

@diegoleme
Copy link
Author

You say create an adapter the lowdb for fortune js?

@typicode
Copy link
Owner

typicode commented Apr 7, 2015

Actually, I may not have been very clear with my thoughts ^_^

So, JSON Server is lowdb + an Express router.
lowdb is what lets you have a simple JSON file as a database.

I was thinking that if there was a lowdb adapter for Fortune as there is for MongoDB, SQLite, ... that would create an experience similar to JSON Server (where you can use a text editor to edit the database) but with an API that follows the JSON API standard.

But, after giving a second thought. I'm not sure it's worth the effort if you just need a JSON API back-end.
So, I think the best would be to stick to Fortune only and forget about what I said. There may be other modules implementing JSON API as well.

Hope it makes more sense?

@diegoleme
Copy link
Author

I think VERY interesting the way the json-server. Run without extra configuration and using json.

Fortune is another amazing tool, more complete, but requires a pre config.

Join the simplicity of json-server with the power of fortune. I think it would be amazing.

I am willing to code something

@robcolburn
Copy link

@typicode - weird your link above got messed up by Markdown, copy-paste fixed it
Fortune: https://github.com/fortunejs/fortune

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

No branches or pull requests

3 participants