Skip to content

peterrhodesdev/json-server-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JSON Server starter

Starter project for a JSON Server fake REST API.

Check out this blog post for more details.

Get the code

Use one of the methods given below to get the project source code on your local machine.

Clone

SSH:

git clone git@github.com:peterrhodesdev/json-server-starter.git

HTTPS:

git clone https://github.com/peterrhodesdev/json-server-starter.git

GitHub CLI:

gh repo clone peterrhodesdev/json-server-starter

Fork and clone

gh repo fork peterrhodesdev/json-server-starter --clone=true

Add a remote + pull

mkdir 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 main

Install dependencies

In the project root directory run

npm install

Run

Run the following command to startup the server

node server.js

By 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.json

To stop the server press ctrl + C.

About

Starter project for a JSON Server fake REST API.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published