Access environment variable in application.yml in a micronaut app

Viewed 1606

I have a token in my server, stored in an environment variable called TOKEN_URL

I want to access this variable in the Micronaut's configuration yml like this:

bot:
  token:
    value: ${env.TOKEN_URL}

Is there a way to access my env in this file? (${env.TOKEN_URL} is NOT working).

1 Answers

Have you tried just ${TOKEN_URL}?

For the documentation on this, check out the "Property value binding" section of the micronaut docs.

Related