NOTHING I do will get json-server to acknowledge changes to the db.json file. After reading https://github.com/typicode/json-server/issues/177. I have tried clearing the cache and closed all browser connections etc. (which is a pain enough in a workflow...) but still the data and schema persists in its last used state.
REST calls change the data, and the changes can be seen, that is working fine. But I need to change the schema...
How do I get json-server to restart using what is in the db.json file??
JSON Server is a Node Module that you can use to create demo REST JSON services within a short span of minutes. All we need to do is have a JSON file as sample data. Let's learn more about how to install and set up a JSON server in our system and alongside we'll try to create a REST API.
JSON Server is a simple project that helps you to setup a REST API with CRUD operations very fast. The project website can be found at https://github.com/typicode/json-server. In the following you'll lean how to setup JSON server and publish a sample REST API.
In case it helps anyone else. I started json-server from the wrong folder, so it created and loaded a default db.json. I did not catch the warning
Oops, db.json doesn't seem to exist
Creating db.json with some default data
on the very first startup. So I was altering the "wrong" file!!! Just a note in case anyone else gets caught out.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With