Skip to content

chidimo/Express-API-Template

Repository files navigation

Express API template

Build Status Coverage Status Maintainability Test Coverage Build status

Live API endpoint: https://express-api-template.herokuapp.com/v1

Read the article here https://www.smashingmagazine.com/2020/04/express-api-backend-project-postgresql/

How to run the app

  1. Clone the repo

  2. Create a .env file at the project root and provide the following environment variables

    TEST_ENV_VARIABLE="some arbitrary string" CONNECTION_STRING="a url pointing to a PostgreSQL database" PORT="port number to serve the files. defaults to 3000"

  3. Open a terminal in the project root and run yarn install to install the project dependencies.

  4. Run yarn test to make sure everything is working correctly.

  5. Run yarn startdev to start the development server

  6. Open http://localhost:3000 or use whatever port you supplied in your environment variable.

  7. Remember to replace the badges with your custom badges

How to test

  1. Run yarn install to install project dependencies
  2. Run yarn test