This is the service tier node application supporting the Check for flooding service https://github.com/DEFRA/flood-app
Create a .env file at the root of the project to set your environment variables locally, which is especially useful during development. The dotenv package facilitates this by automatically loading these variables at application start. This approach is recommended as a simpler alternative to global settings, like those in .bashrc.
For DEFRA employees, these environment variables are available in our private lfwconfig repository.
name | description | required | default | valid | notes |
---|---|---|---|---|---|
NODE_ENV | Node environment | no | production | development, dev, test, tst, production | |
PORT | Port number | no | 3000 | ||
FLOOD_SERVICE_CONNECTION_STRING | PG Connection String | yes | |||
FLOOD_SERVICE_S3_ACCESS_KEY | S3 Access Key | yes | |||
FLOOD_SERVICE_S3_SECRET_ACCESS_KEY | S3 Secret Key | yes | |||
FLOOD_SERVICE_S3_BUCKET | S3 Bucket | yes | |||
FLOOD_SERVICE_S3_TIMEOUT | S3 Http Timeout | no | 10000 (10s) | ||
ERRBIT_PROJECT_KEY | Errbit Project Key | no | |||
ERRBIT_ENABLED | Errbit Enabled | no |
Local or remote Postgres/Postgis database installed from: https://github.com/DEFRA/flood-db, connection string FLOOD_SERVICE_CONNECTION_STRING
AWS serverless lfw-data tier processing telemetry, forecast, 5DF, fwis data and storing in the database: https://github.com/DEFRA/lfw-data
S3 Bucket storing some of the processed data files, referred to as FLOOD_SERVICE_S3_BUCKET
in the env vars
Node v8+
$ npm i
$ npm run test
$ npm i
$ npm run start:local