Step 4: Add secret
The sample application will not run without an API key from
https://newsapi.org/. The use of
an API key allows the tutorial to include the
qaskx-cli setup secret --help command.
So before running the news application, let’s:
- Get an API key
- Save it as a secret
- Use the API key from the secret store when starting the application
In many organisations, there exists a convention where build scripts reside and their name. Alternativel the IDE may have a convention or understand the build.
With
.. Test first
.. Open in editor
.. go version in 1.12.9
.. go mod tidy
.. go build .\main.go
.. run needs API key
.. get API key https://newsapi.org/
And now we can move onto the next Step.
Errors
If the above did produce error messages, please re-run the command with the additional argument of “-v” for verbose logging to console.