with npm: npm install
with yarn: yarn install
-
install json server globally.
with npm: npm install -g json-server
with yarn: yarn global add json-server -
edit the parameter REACT_APP_API_URL exist in ProjectDir/.env file with your chosen fake json api IP.
-
launch:
json-server --watch src/db.json --routes src/routes.json --host YOUR_API_IP -p YOUR_API_PORT_NUMBER
please don't forget to allow in your firewall both your fake api ip/port_number and your react app ip/port_number.
with npm: npm start
with yarn:: yarn start
login: admin@admin.com
password: GMAdmin2019