Skip to content

Commit

Permalink
Merge pull request #1992 from digitallyinduced/amitaibu-patch-4
Browse files Browse the repository at this point in the history
Improve docs on Using Custom Config Parameters
  • Loading branch information
mpscholten authored Jul 24, 2024
2 parents c4b8993 + b50a185 commit 9da30cd
Showing 1 changed file with 6 additions and 2 deletions.
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

0 comments on commit 9da30cd

Please sign in to comment.