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/
-
Clone the repo
-
Create a
.env
file at the project root and provide the following environment variablesTEST_ENV_VARIABLE="some arbitrary string" CONNECTION_STRING="a url pointing to a PostgreSQL database" PORT="port number to serve the files. defaults to 3000"
-
Open a terminal in the project root and run
yarn install
to install the project dependencies. -
Run
yarn test
to make sure everything is working correctly. -
Run
yarn startdev
to start the development server -
Open
http://localhost:3000
or use whatever port you supplied in your environment variable. -
Remember to replace the badges with your custom badges
- Run
yarn install
to install project dependencies - Run
yarn test