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

Possible to write to files? #46

Closed
zeke opened this issue Feb 5, 2015 · 2 comments
Closed

Possible to write to files? #46

zeke opened this issue Feb 5, 2015 · 2 comments

Comments

@zeke
Copy link

zeke commented Feb 5, 2015

When I saw in the readme that PUT and POST requests are supported, I expected that to mean the underlying JSON files can be written to via HTTP. Is that the case?

If not, wouldn't that be cool?!

@typicode
Copy link
Owner

typicode commented Feb 5, 2015

Hi Zeke,

It's the case (or else it's a bug).
When you provide a JSON file, changes are persisted to it:

$ json-server file.json # will write

But in other cases, it won't

$ json-server file.js # won't write
$ json-server http://somewhere.com/file.json # won't write

You can always type s when JSON Server is running in terminal to save current database state.

@zeke
Copy link
Author

zeke commented Feb 5, 2015

awesome. Can't wait to give this a try.

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