Skip to content

Latest commit

 

History

History
61 lines (39 loc) · 1.14 KB

README.md

File metadata and controls

61 lines (39 loc) · 1.14 KB

SpyLogic : API

This is the backend module of the SpyLogic app. We are using Express to serve the API.

In production (containerised) and development modes we only serve the API. However, in prodlite mode we also host the UI through the Express server; the advantages of this are not needing to worry about CORS, and Cookies do not need to be secure, as API and UI are same origin and same site.

Install

npm ci

Setup Environment

See the main README for setting up environment variables.

Run

development

Start the API and hot-reload on changes:

npm run dev

prodlite

Start the API and host the UI:

# If you've not yet built the frontend, do this first:
cd ../frontend && npm run build
cd ../backend

# Run the app:
npm start

production

There is a Dockerfile for running the API in a container.

Linting and Formatting

To manually lint and format:

npm run lint
npm run format

Test

We use Jest for the backend tests.

npm test