For development of the system, see
The service's test database requires at least PostgreSQL 9.6, but the schemas only require support for JSONB.
To run the database tests against the server (requires postgresql):
$ . /nvm.sh $ nvm install $ npm install $ cp env/integration.env current.env $ npm run test-acceptance --silent
To start the server in staging or production mode:
$ . /nvm.sh $ nvm install $ npm install --production $ cp env/production.env current.env $ npm run start-backend
required data files
Use the exclude list when the build server makes an archive file of the result of the build. Use like this:
tar -X tools/archive-excludes.txt -cz -f $JOB_BASE_NAME-$BUILD_NUMBER.tar.gz .
The backend service controlled by environment variables. Most scripts assume that such variables are set in your local file
current.env. If you are just running the system on your own machine during development, you can most likely just use an empty
current.env, but it has to exist. The
env directory holds templates for other used configurations. If you need to tweak settings, the application obeys the following environment variables.
|AUTH_CLIENT_ID||content-first||Id known to authentication service|
|AUTH_CLIENT_SECRET||something||Secret known to authentication service & salt for hashing|
|AUTH_URL||https://auth.dbc.dk||Where to contact authentication service|
|COMMUNITY_NAME||Læsekompasset||Id in community service|
|COMMUNITY_URL||http://localhost:3003||Where to contact community service|
|DB_CONNECTIONS_POOL_MAX||10||Maximum connections in DB pool|
|DB_CONNECTIONS_POOL_MIN||2||Minimum connections in DB pool|
|DB_NAME||contentfirst||Name of the database|
|INTERNAL_PORT||3002||TCP port for the internal service|
|LOG_LEVEL||INFO||Verbosity of service log (OFF, ERROR, WARN, WARNING, INFO, DEBUG, TRACE)|
|LOG_SERVICE_ERRORS||1||Record all 5xx errors (1), or ignore 5xx errors (0)|
|LOGIN_URL||https://login.bib.dk||Where to contact Adgangsplatform|
|NODE_ENV||development||Controls other service settings (development, ci, production)|
|PORT||3001||TCP port for the public service|
|PRETTY_LOG||1||Pretty printed log statements (1), or one-line log statements (0)|
The backend service has the following admistrative endpoints:
||Returns the service status as JSON.|
||Returns the process id of the service.|
||Cleans up database and returns statistics about the service.|
See also service endpoints.