Skip to content

Instantly share code, notes, and snippets.

@lukePeavey
Last active September 23, 2019 17:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukePeavey/76f3f2c42f86db330464ce86502e3a35 to your computer and use it in GitHub Desktop.
Save lukePeavey/76f3f2c42f86db330464ce86502e3a35 to your computer and use it in GitHub Desktop.
Contributor guidelines for Quotable API

All contributions are greatly appreciated!!

Issues

  • Feature requests/enhancements
  • Bug reports
  • Questions/feedback

Pull Requests

  1. Fork the repository on GitHub.

  2. Clone the forked repo to your local machine.

  3. Create a new feature branch from master

  4. Commit your changes

  5. Push your changes back up to your fork.

  6. When you're ready, submit a pull request so that we can review your changes

NOTE: If you have an existing fork, make sure to pull the latest changes from the upstream repository before working on a new contribution.

$ git remote add upstream https://github.com/lukePeavey/quotable.git
$ git pull upstream master

Running the API Locally

If you are working on changes to the source code, you will want to run the server locally so you test your changes as you work.

Requirements

  • Node >= 12.x
  • NPM >= 6.x
  • MongoDB

1. Create a database

You can install and run MongoDB locally, or use a cloud-based service like MongoDB Atlas (recommended).

Using MongoDB Atlas:

  • Follow the instruction in the getting started guide to provision a new database.
  • Open the "Connect" dialog and select "Connect to Your Application" to get the connection string.

2. Environment Variables

Create a file called .env in the root directory of the project.

Set MONGODB_URI to the connection string for your database.

# Example
MONGODB_URI=mongodb://<user>:<password>@ds013911.mlab.com:13911/quotable

3. Install dependencies

$ npm run install

4. Seed the database

This will populate your database with the sample data included in the repo.

$ npm run database:seed

4. Start the Server

$ npm run start

5. Running Tests

$ npm run test --watchAll
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment