From 89319e096013cffc0132e721c1d9153fde1731e1 Mon Sep 17 00:00:00 2001 From: Nicolas Dupont Date: Tue, 14 May 2024 09:10:23 +0200 Subject: [PATCH] Unify case in config --- CHANGELOG.md | 4 ++-- src/collection-api/routes/docs.test.js | 2 +- src/collection-api/routes/services.test.js | 2 +- src/collection-api/routes/versions.test.js | 2 +- src/collection-api/server.js | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 40d0af579..03c2837c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,8 +9,8 @@ All changes that impact users of this module are documented in this file, in the ### Changed - **Breaking:** All configurations are now nested under the `@opentermsarchive/engine` key. Update your `config/production.json` by wrapping its content like this: `{ @opentermsarchive/engine: { < your previous configuration >}}`. -- **Breaking:** The `api` configuration key has been renamed to `collection-api`. Update this in your `config/production.json`. -- **Breaking:** Default values for `port` and `basePath` in `collection-api` have been removed. Specify these configurations explicitly in your `config/production.json`. +- **Breaking:** The `api` configuration key has been renamed to `collectionAPI`. Update this in your `config/production.json`. +- **Breaking:** Default values for `port` and `basePath` in `collectionAPI` have been removed. Specify these configurations explicitly in your `config/production.json`. - **Breaking:** All environment variables are now prefixed with `OTA_ENGINE_`. Update variables such as `SENDINBLUE_API_KEY` to `OTA_ENGINE_SENDINBLUE_API_KEY`, `SMTP_PASSWORD` to `OTA_ENGINE_SMTP_PASSWORD`, and `GITHUB_TOKEN` to `OTA_ENGINE_GITHUB_TOKEN`. ## 1.2.1 - 2024-05-09 diff --git a/src/collection-api/routes/docs.test.js b/src/collection-api/routes/docs.test.js index f28bbec80..6f6366b35 100644 --- a/src/collection-api/routes/docs.test.js +++ b/src/collection-api/routes/docs.test.js @@ -4,7 +4,7 @@ import request from 'supertest'; import app from '../server.js'; -const basePath = config.get('@opentermsarchive/engine.collection-api.basePath'); +const basePath = config.get('@opentermsarchive/engine.collectionAPI.basePath'); describe('Docs API', () => { describe('GET /docs', () => { diff --git a/src/collection-api/routes/services.test.js b/src/collection-api/routes/services.test.js index db6bdc16f..8b661e139 100644 --- a/src/collection-api/routes/services.test.js +++ b/src/collection-api/routes/services.test.js @@ -4,7 +4,7 @@ import request from 'supertest'; import app from '../server.js'; -const basePath = config.get('@opentermsarchive/engine.collection-api.basePath'); +const basePath = config.get('@opentermsarchive/engine.collectionAPI.basePath'); describe('Services API', () => { describe('GET /services', () => { diff --git a/src/collection-api/routes/versions.test.js b/src/collection-api/routes/versions.test.js index 96c3df60c..a596a6391 100644 --- a/src/collection-api/routes/versions.test.js +++ b/src/collection-api/routes/versions.test.js @@ -7,7 +7,7 @@ import Version from '../../archivist/recorder/version.js'; import { toISODateWithoutMilliseconds } from '../../archivist/utils/date.js'; import app from '../server.js'; -const basePath = config.get('@opentermsarchive/engine.collection-api.basePath'); +const basePath = config.get('@opentermsarchive/engine.collectionAPI.basePath'); const { expect } = chai; const request = supertest(app); diff --git a/src/collection-api/server.js b/src/collection-api/server.js index 048035af9..2e662259b 100644 --- a/src/collection-api/server.js +++ b/src/collection-api/server.js @@ -15,12 +15,12 @@ if (process.env.NODE_ENV !== 'test') { app.use(loggerMiddleware); } -const BASE_PATH = path.join('/', config.get('@opentermsarchive/engine.collection-api.basePath'), 'v1'); +const BASE_PATH = path.join('/', config.get('@opentermsarchive/engine.collectionAPI.basePath'), 'v1'); app.use(BASE_PATH, apiRouter(BASE_PATH)); app.use(errorsMiddleware); -const port = config.get('@opentermsarchive/engine.collection-api.port'); +const port = config.get('@opentermsarchive/engine.collectionAPI.port'); app.listen(port);