Providing meta data on devices and deployments. Consumed by Device Management Console, Companion App and Arbimon
Requirements:
- Node
- yarn
- Postgres (see below)
Install dependencies
yarn
// TODO: Configure environment variables? Shouldn't be needed if using Docker.
Run local dev serve (live reload)
yarn serve
Start Postgres container
docker run -d --rm --name pg -e POSTGRES_PASSWORD=test -p 5432:5432 postgres
Create the schema needed
docker exec -it pg psql -U postgres --command "create schema sequelize;"
Run the migrations
yarn migrate
You are ready to run yarn serve
and test the endpoints.
Run lint:
yarn lint
Tests are to test a set of component (functions, modules) working together which it requires a database open (it is requirement to this API).
To run all the tests, you will need to have a test database running. It is recommented to use a separated database from your development database because the data will be dropped from the tables when running tests.
To start a test database (requires Docker to be running):
yarn serve-db:test
Run tests:
yarn test