data-normalization-service
v1.5.0
Published
Normalizes extracted data
Downloads
2
Readme
Digicust Data Normalization Service
Normalizes extracted data
Architecture
Business logic in src/service
Controllers (src/api/controller) are triggered by either service bus (src/api/service-bus) or express routers (src/api/routes)
Development & Deployment
Install Dependencies
npm i
Start Service
npm start
Testing Framework
We use Mocha and Chai with Chai-Http. This combination allows us to first start the server (load key vault values, start Express, ...) and then programmatically simulate requests.
Tests are coded in ./tests and allow for TypeScript.
npm test
Tests will automatically be processed with every Docker build (see Dockerfile)
Testing an Individual Case
You can test individual cases by pasting the case JSON (find it via https://support-tool.digicust.com/caseFetch) to /tests/test-data/dynamic.json
In tests/test.ts set it.skip("Dynamic Case", async function () to it.only
Then run
npm test
You will find the output in /tests/test-data/dynamic-output.json
In tests/test.ts set it.only("Dynamic Case", async function () back to it.skip
Environmental Variables
NODE_ENV=development
PORT=3005
AZURE_KEYVAULT_URI=https://backend-key-vault.vault.azure.net/
AZURE_CLIENT_ID=8deae3b1-24e3-4320-bda6-fa39fcbbcf1f
AZURE_CLIENT_SECRET=
AZURE_TENANT_ID=bf2e212e-cf03-4606-beaf-7715d6f28009
Docker Deployment
sudo docker build . -t digicust/<service-name>
sudo docker run --env-file ./.env -d digicust/<service-name>
Azure Deployment
This app can be deployed as an Azure App Service. Configure deployment via private repository, add dockerhub credentials and copy CI webhook to Dockerhub. Make sure to add the 6 basic environmental variables. Create Backend Pool in the Application Gateway. Check whether health probe is positive.