- Instructions and initial repo cloned from json-server-heroku
- Addional instructions for me to make this work: json-faker-server
- The mock api files using Faker.js came from The Bouqs front end challenge repository
- Clone this repo:
git clone git@github.com:hunter547/bouqs-challenge-backend.git
- cd into the project:
cd bouqs-challenge-backend
- Run the generate script:
npm run generate
- Add your files:
git add .
- Commit your files:
git commit -m "yay I have a database."
- Create an account on Heroku.
- Install the Heroku CLI on your computer.
- Then, log into Heroku from the CLI:
heroku login
- Within the bouqs-challenge-backend project folder, create a Heroku project:
heroku create my-cool-app
- Then push your commited changes form step 5 to Heroku:
git push heroku master
- Open your app once it's finished building:
heroku open
This script runs the db.js file to generate data using faker.js and outputs the JSON result to a file called db.json. Then when Heroku runs npm start on server.js, server.js uses that file as its source to handle requests and serve data.