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

Improve docs on Using Custom Config Parameters #1992

Merged
merged 1 commit into from
Jul 24, 2024
Merged
Changes from all commits
Commits
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
8 changes: 6 additions & 2 deletions Guide/config.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,18 @@ If you are ok to commit your secrets to git repo, you can also put the env vars
You can now access the `StripePublicKey` parameter by calling `getAppConfig @Config.StripePublicKey`:

```haskell
import qualified Config

action MyAction = do
let (StripePublicKey stripePublicKey) = getAppConfig @Config.StripePublicKey

putStrLn ("Stripe public key: " <> stripePublicKey)
```

If you want to fetch it in a helper function, we need to define the `?context`:

```haskell
getStripePublicKey :: (?context :: ControllerContext) => StripePublicKey
getStripePublicKey = getAppConfig @Config.StripePublicKey
```

## Environment Variables

Expand Down