Starter project for a JSON Server fake REST API.
Check out this blog post for more details.
Use one of the methods given below to get the project source code on your local machine.
SSH:
git clone git@github.com:peterrhodesdev/json-server-starter.gitHTTPS:
git clone https://github.com/peterrhodesdev/json-server-starter.gitGitHub CLI:
gh repo clone peterrhodesdev/json-server-startergh repo fork peterrhodesdev/json-server-starter --clone=truemkdir json-server-starter
cd json-server-starter
git init
git remote add json-server-starter git@github.com:peterrhodesdev/json-server-starter.git
git pull json-server-starter mainIn the project root directory run
npm installRun the following command to startup the server
node server.jsBy default the server loads the data from db.json into memory so that the file isn't modified. To allow HTTP requests to be able to modify the contents of db.json then run as
node server.js db.jsonTo stop the server press ctrl + C.