Skip to content

Commit 4e95a46

Browse files
ajeetrainadvdksn
andauthored
Update content/guides/use-case/wiremock.md
Co-authored-by: David Karlsson <[email protected]>
1 parent b43b739 commit 4e95a46

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

content/guides/use-case/wiremock.md

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -159,27 +159,6 @@ Follow the steps to setup a non-containerized Node application:
159159
}
160160
```
161161
162-
> [!TIP]
163-
> For the production environment, it's recommended not to expose API keys details in logs. Instead, you can log a placeholder message to indicate whether the API key is loaded:
164-
165-
```javascript
166-
const API_KEY = process.env.ACCUWEATHER_API_KEY;
167-
168-
console.log('API_ENDPOINT_BASE:', API_ENDPOINT_BASE); // Log after it's defined
169-
console.log('ACCUWEATHER_API_KEY is set:', !!API_KEY); // Log a boolean value instead of the actual key
170-
171-
if (!API_ENDPOINT_BASE) {
172-
throw new Error("API_ENDPOINT_BASE is not defined in environment variables");
173-
}
174-
175-
// Only check for API key if not using WireMock
176-
if (API_ENDPOINT_BASE !== 'http://localhost:8080' && !API_KEY) {
177-
throw new Error("ACCUWEATHER_API_KEY is not defined in environment variables");
178-
}
179-
```
180-
181-
> This approach ensures that you only log whether the key is set without revealing its value.
182-
183162
4. Start the Node server
184163
185164
Before you start the Node server, ensure that you have already installed the node packages listed in the package.json file by running `npm install`.

0 commit comments

Comments
 (0)