From b552ca379ab7e79e107032be33cc3c84186e609f Mon Sep 17 00:00:00 2001 From: Omkar Zade Date: Tue, 5 Aug 2025 13:43:07 +0200 Subject: [PATCH] Add Configuration section to README and an example config.json --- README.md | 10 +++++++++- src/assets/config.example.json | 15 +++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 src/assets/config.example.json diff --git a/README.md b/README.md index 0026e36f..a04b2188 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,15 @@ e2e tests check content is rendered correctly npm run e2e ``` - +### Configuration +Config can be set in one of the three ways, _in decreasing order of precedence_ (see [app-config.service](src/app/app-config.service.ts)): +1. By returning an AppConfig with a backend `/config` endpoint +2. By serving the AppConfig stored as static asset in [/assets/config.json](src/assets/config.example.json), or +3. By exporting it from a TypeScript file from [environmets/environment.ts](src/environments/environment.ts). The `environment.ts` file gets replaced based on build configuration passed to `ng build` (See [angular.json](./angular.json)). + +While many settings in AppConfig are self-explanatory, the following optional settings pertain to optional features: +- `statusCode`: Can be set to `INFO`, `WARN`, or `NONE` to show a status banner at the top of the page. The message can be set with `statusMessage`. +- `contactEmail`: If set, a message with contact email will be shown in the footer of the page. ## Deployment diff --git a/src/assets/config.example.json b/src/assets/config.example.json new file mode 100644 index 00000000..a166f578 --- /dev/null +++ b/src/assets/config.example.json @@ -0,0 +1,15 @@ +{ + "accessDataHref": null, + "accessInstructions": "Instructions: Login with brightness username and password", + "directMongoAccess": true, + "doiBaseUrl": "https://doi.org/", + "facility": "ess", + "lbBaseUrl": "http://localhost:3000", + "oaiProviderRoute": "http://localhost:3001", + "production": false, + "scicatBaseUrl": "http://localhost", + "showLogoBanner": true, + "statusCode": "INFO", + "statusMessage": "This is a customizable status message", + "contactEmail": "support@scicat.eu" +} \ No newline at end of file