Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 2 New Use Case Guides - Pre-Seeding database and WireMock #20968

Merged
merged 63 commits into from
Oct 21, 2024
Merged
Changes from 1 commit
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
9529e15
Added a use case guide for Pre-seeding database
ajeetraina Sep 22, 2024
1e9ae51
Fixed formatting
ajeetraina Sep 22, 2024
4dfd9c8
Fixed vale linting
ajeetraina Sep 22, 2024
f6108a4
Merge branch 'docker:main' into main
ajeetraina Sep 23, 2024
0e3fb75
Merge branch 'docker:main' into main
ajeetraina Sep 24, 2024
d29972b
Added WireMock use case guide
ajeetraina Sep 24, 2024
3590f13
Update content/guides/use-case/pre-seeding.md
ajeetraina Oct 4, 2024
58afb5c
Merge branch 'docker:main' into main
ajeetraina Oct 4, 2024
d1bd4c2
Merge branch 'docker:main' into main
ajeetraina Oct 6, 2024
2869e1e
Update content/guides/use-case/pre-seeding.md
ajeetraina Oct 6, 2024
c321415
Update content/guides/use-case/pre-seeding.md
ajeetraina Oct 6, 2024
5e4b517
Update content/guides/use-case/pre-seeding.md
ajeetraina Oct 6, 2024
70c4efe
Update content/guides/use-case/pre-seeding.md
ajeetraina Oct 6, 2024
6914cae
Update content/guides/use-case/pre-seeding.md
ajeetraina Oct 6, 2024
fda112f
Update content/guides/use-case/pre-seeding.md
ajeetraina Oct 6, 2024
2987bb5
Update content/guides/use-case/pre-seeding.md
ajeetraina Oct 6, 2024
f8435ca
Update content/guides/use-case/pre-seeding.md
ajeetraina Oct 6, 2024
4ff3dfa
Update content/guides/use-case/pre-seeding.md
ajeetraina Oct 6, 2024
5745232
Update content/guides/use-case/pre-seeding.md
ajeetraina Oct 6, 2024
ee0eba7
Update content/guides/use-case/pre-seeding.md
ajeetraina Oct 6, 2024
b6fa7a1
Removed psql instructions under the prerequisite
ajeetraina Oct 6, 2024
fe3512d
Removed the statement that ask user to enter password
ajeetraina Oct 6, 2024
e4e4555
Removed Windows Tips as we're using command
ajeetraina Oct 6, 2024
7fd0852
Modified the volume section
ajeetraina Oct 6, 2024
94cbd0c
added a note for port mapping
ajeetraina Oct 6, 2024
934ce4c
Update content/guides/use-case/wiremock.md
ajeetraina Oct 7, 2024
7da383d
Update content/guides/use-case/wiremock.md
ajeetraina Oct 7, 2024
88ecb1e
Update content/guides/use-case/wiremock.md
ajeetraina Oct 7, 2024
b90e6c4
Update content/guides/use-case/wiremock.md
ajeetraina Oct 7, 2024
2661b76
Update content/guides/use-case/wiremock.md
ajeetraina Oct 7, 2024
db60567
Merge branch 'docker:main' into main
ajeetraina Oct 7, 2024
61cf3c3
Removed bold cases
ajeetraina Oct 7, 2024
9d3a951
Added instructions for Node and NPM
ajeetraina Oct 7, 2024
3880d2e
Moved the index.js file explanation up in step 3
ajeetraina Oct 7, 2024
8fde962
Added a prerequisite for WireMock
ajeetraina Oct 7, 2024
c4a1367
Added list of sections in the inital para
ajeetraina Oct 7, 2024
22ab168
Added missing instructions
ajeetraina Oct 7, 2024
5099218
Merge branch 'docker:main' into main
ajeetraina Oct 17, 2024
4cd89fb
Modified wiremock guide
ajeetraina Oct 17, 2024
b810a76
linting and fixes
ajeetraina Oct 17, 2024
a2cf8af
Update content/guides/use-case/pre-seeding.md
ajeetraina Oct 18, 2024
adb77c4
Update content/guides/use-case/wiremock.md
ajeetraina Oct 18, 2024
092a8b6
Update content/guides/use-case/pre-seeding.md
ajeetraina Oct 18, 2024
3d33c4b
Merge branch 'docker:main' into main
ajeetraina Oct 18, 2024
ded4415
avoid exposing API keys in logs
ajeetraina Oct 18, 2024
d67d370
Fixed formatting
ajeetraina Oct 18, 2024
08aa824
Fixed the result for Wiremock
ajeetraina Oct 21, 2024
07a2a8d
Update content/guides/use-case/pre-seeding.md
ajeetraina Oct 21, 2024
11621c4
Update content/guides/use-case/pre-seeding.md
ajeetraina Oct 21, 2024
18df690
Update content/guides/use-case/pre-seeding.md
ajeetraina Oct 21, 2024
6c50e2a
Update content/guides/use-case/pre-seeding.md
ajeetraina Oct 21, 2024
542105e
Update content/guides/use-case/pre-seeding.md
ajeetraina Oct 21, 2024
4ea1b7b
Update content/guides/use-case/wiremock.md
ajeetraina Oct 21, 2024
d3e870e
Update content/guides/use-case/wiremock.md
ajeetraina Oct 21, 2024
e6daae7
Update content/guides/use-case/wiremock.md
ajeetraina Oct 21, 2024
91b4aa2
Update content/guides/use-case/wiremock.md
ajeetraina Oct 21, 2024
8ca3301
Update content/guides/use-case/pre-seeding.md
ajeetraina Oct 21, 2024
dd6d98c
Update content/guides/use-case/pre-seeding.md
ajeetraina Oct 21, 2024
8c0a9e0
Update content/guides/use-case/pre-seeding.md
ajeetraina Oct 21, 2024
a9a1d18
Update content/guides/use-case/wiremock.md
ajeetraina Oct 21, 2024
b43b739
Update content/guides/use-case/wiremock.md
ajeetraina Oct 21, 2024
4e95a46
Update content/guides/use-case/wiremock.md
ajeetraina Oct 21, 2024
2f859f2
Fixing linting issues
ajeetraina Oct 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update content/guides/use-case/wiremock.md
Co-authored-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
  • Loading branch information
ajeetraina and dvdksn authored Oct 21, 2024
commit 4e95a4629547398b80e467282298edc9715e89c6
21 changes: 0 additions & 21 deletions content/guides/use-case/wiremock.md
Original file line number Diff line number Diff line change
@@ -101,7 +101,7 @@
### Prerequisite

- Install [Node.js and npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)
- Ensure that WireMock container is up and running (see [Launching Wiremock](#launching-wiremock)

Check failure on line 104 in content/guides/use-case/wiremock.md

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'WireMock' instead of 'Wiremock'. Raw Output: {"message": "[Vale.Terms] Use 'WireMock' instead of 'Wiremock'.", "location": {"path": "content/guides/use-case/wiremock.md", "range": {"start": {"line": 104, "column": 68}}}, "severity": "ERROR"}


Follow the steps to setup a non-containerized Node application:
@@ -159,27 +159,6 @@
}
```

> [!TIP]
> 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:

```javascript
const API_KEY = process.env.ACCUWEATHER_API_KEY;

console.log('API_ENDPOINT_BASE:', API_ENDPOINT_BASE); // Log after it's defined
console.log('ACCUWEATHER_API_KEY is set:', !!API_KEY); // Log a boolean value instead of the actual key

if (!API_ENDPOINT_BASE) {
throw new Error("API_ENDPOINT_BASE is not defined in environment variables");
}

// Only check for API key if not using WireMock
if (API_ENDPOINT_BASE !== 'http://localhost:8080' && !API_KEY) {
throw new Error("ACCUWEATHER_API_KEY is not defined in environment variables");
}
```

> This approach ensures that you only log whether the key is set without revealing its value.

4. Start the Node server

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`.
@@ -224,7 +203,7 @@
> [!TIP]
> Before you proceed to the next step, ensure that you stop the node application service.

## Use a Live API in production to fetch real-time weather data from AccuWeather

Check warning on line 206 in content/guides/use-case/wiremock.md

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Docker.HeadingLength] Try to keep headings short (< 8 words). Raw Output: {"message": "[Docker.HeadingLength] Try to keep headings short (\u003c 8 words).", "location": {"path": "content/guides/use-case/wiremock.md", "range": {"start": {"line": 206, "column": 4}}}, "severity": "INFO"}

To enhance your Node.js application with real-time weather data, you can seamlessly integrate the AccuWeather API. This section of the guide will walk you through the steps involved in setting up a non-containerized Node.js application and fetching weather information directly from the AccuWeather API.

Loading