Skip to content

Interpolates environment variables in Dropwizard YAML configurations

Notifications You must be signed in to change notification settings

ingenieux/dropwizard-envvar

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Interpolates environment variables in Dropwizard YAML configurations.

Usage

In your Application class

public void initialize( Bootstrap bootstrap ) {
	bootstrap.addBundle( new EnvironmentVariableInterpolationBundle() );

In your YAML configuration

# This is just an example
mongo:
  host: ${MONGO_HOST}
  port: ${MONGO_PORT}

Notes

This bundle will fail fast, i.e. if an environment variable is not found, it will throw an EnvironmentException:

EnvironmentException: The environment variable 'MONGO_HOST' is not defined; could not substitute the expression '${MONGO_HOST}'.

About

Interpolates environment variables in Dropwizard YAML configurations

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%