express-nobabel-nocry-template

An repository template for express application with minimal use of babel

Stars
0

Express Api Template

A starter template for express with:

  • Handlers for 404 and health checks
  • tests written in jest and supertest
  • with eslint and prettier pre-configured
  • almost zero babel use; babel is used to transform tests for jest but all server code is transformed via esm

See engine field in package.json for minimum node/npm requirements.

Developer commands

Install

npm run ci

Run the api

For dev

npm run start:dev

For production

npm run start

Code hygiene

npm run lint # eslint
npm run format # prettier

Tests

Run once

npm run test
npm run test:watch

CI commands

There is a Dockerfile supplied that can be run using make. Additionally, CI tasks can be run using Github Actions. Both can be tested using the Makefile. For running github action workflows locally, act is required to be installed.

make build # build the docker image
make run # run the docker image
make gha_build # run the build workflow
make gha_pull_request # Run the pull_request event
make gha_list # list workflows

Example Requests

  • /health-check - health check endpoint
    • returns 200 if service is healthy or 503 if service is sick