The document list the environment variable options for server
to deploy to the environment. Also how to test in the local environment.
Setting env variables with format: NVD_
+ Upper($VAR) works the same as argvs
- E.g., setting
NVD_LOGLVL
is the same as given-loglvl
Key | Default | Description |
---|---|---|
NVD_ACS_LOGLVL | info | Access logging level - debug/info/warn/error |
NVD_ERR_LOGLVL | info | Error logging level - debug/info/warn/error |
Key | Default | Description |
---|---|---|
NVD_LISTEN | :8080 | Listen address of API server |
NVD_METRIC | :6060 | Metric address of Prometheus |
Key | Default | Description |
---|---|---|
NVD_DB_TYPE | mongo | DB type (only support mongo so far) |
NVD_DB_USER | User name for DB | |
NVD_DB_PWD | User password for DB | |
NVD_DB_ENDPOINT | DB Endpoint | |
NVD_DB_TIMEOUT | 5s | Timeout of operation to DB |
$ cd go-nvd
$ GOOS=linux go build -o service/build/bin/ ./...
$ cd service/build
$ docker build -t nvd-tools .
DB: mongo
Service folder shows how to run in local environment for testing
- test: run
mongo
andnvd-server
in containers.- API:
http://localhost:8080
- API metrics:
http://localhost:6060/metrics
- mongo:
http://localhost:27017
- mongo express:
http://localhost:8081
- API:
$ cd service/test
$ docker compose -f <yaml_path> up -d
Check readiness endpoint for server
$ curl 'http://localhost:8080/nvd/readiness'