This is repository contains the API for the Partner microservice.
- This uses the mentorhub-mongodb project for a database with test data
- This API supports the mentorhub-partnerui front end.
- Mongo Compass - to look into the database
- Step CI - to run black-box testing
npm install
npm run build
npm run start
NOTE: This will also start the backing database and initlize test data
npm run local
NOTE: This command assumes that the backing services are already running
npm run container
NOTE: This will also start the backing database and initlize test data
npm run stepci
REQUIRES Step CI
NOTE: Step CI tests expect to find the API running at localhost with test data loaded. To build and run the containers with fresh test data before running the StepCI tests use:
npm run blackbox
If you want to do more manual testing, here are the curl commands to use
This endpoint supports the promethius monitoring standards for a healthcheck endpoint
curl http://localhost:8084/api/health/
curl http://localhost:8084/api/config/
curl http://localhost:8084/api/partner/
curl http://localhost:8084/api/partner/bbbb00000000000000000000
curl -X POST http://localhost:8084/api/partner/ \
-H "Content-Type: application/json" \
-d '{"name":"Foo", "description":"Some short description"}'
curl -X PATCH http://localhost:8084/api/partner/bbbb00000000000000000000 \
-H "Content-Type: application/json" \
-d '{"description":"Some long description"}'
curl -X POST http://localhost:8084/api/partner/bbbb00000000000000000000/contact/AAAA00000000000000000000
curl -X DELETE http://localhost:8084/api/partner/bbbb00000000000000000000contact/AAAA00000000000000000000
The api/config/
endpoint will return a list of configuration values. These values are either "defaults" or loaded from an Environment Variable, or found in a singleton configuration file of the same name. Configuration files take precidence over environment variables. The variable "CONFIG_FOLDER" will change the location of configuration files from the default of ./
The api/health/
endpoint is a Promitheus Healthcheck endpoint.
A list of environment variables used by the API and their default values can be found in the Dockerfile. It uses a 2-stage build, and supports both amd64 and arm64 architectures.