October 2019
Intermediate to advanced
426 pages
11h 49m
English
Now, we are going to install and start our backend server by using the json-server tool:
> npm install --save json-server
> npx json-server --watch server/db.json
The npx command executes commands that were installed locally in a project. We need to use npx here, because we did not globally install the json-server tool (via npm install -g json-server).
We executed the json-server tool, and made it watch the server/db.json file that we created earlier. The --watch flag means that it will listen to changes to the file, and refresh automatically.
Now, we can go to http://localhost:3000/posts/react-hooks ...
Read now
Unlock full access