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

Without data return #384

Closed
istommao opened this issue Oct 11, 2016 · 4 comments
Closed

Without data return #384

istommao opened this issue Oct 11, 2016 · 4 comments

Comments

@istommao
Copy link

image
image

But success when url like this

image
image

@typicode
Copy link
Owner

Hi @istommao,

/ aren't supported in db.json, I would suggest having a look at:
https://github.com/typicode/json-server#add-routes
https://github.com/typicode/json-server#custom-output-example

You'll probably have to use the project as a module and add a rewrite rule to handle /api prefix, modify the output to add previous, count, next and results.

Also you'll have to tell JSON Server to use uid instead of id (router.db._.id = 'uid').

These issues can help too:
#359
#382
#371

@istommao
Copy link
Author

I see
thank a lots!

By the way

there is an error in README.md
image

res.Header is not a function
image

And i change res.Header to lowercase it works!
image

@typicode
Copy link
Owner

Thank you for the heads-up! :)

@istommao
Copy link
Author

You are welcome!

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

2 participants