Unable to access Heroku environment config in dropwizard yaml config file -


i have implemented simple rest api using dropwizard , trying launch on heroku. stuck @ point want access postgresql db on heroku. not able access configuration on heroku. have config vars set on heroku below:

 $ heroku config  heroku_database_url:<some value>  heroku_database_username:<some value>  heroku_database_password:<some value> 

i accessing them in dropwizard app along other config settings in config.yml as:

database:   driverclass: org.postgresql.driver   user: heroku_database_username   password: heroku_database_password   url: jdbc:postgresql:heroku_database_url 

i have tried :

system.getenv("heroku_database_username") 

but none of these work.

if substitute actual values service works.

can point me correct way of resolving/accessing config settings heroku?

dropwizard lets pass in configuration options on command line -d flags (see note here), in procfile can start server java -ddw.database.user=$heroku_database_username ... -jar app.jar server use environment variables.


Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

image - ClassNotFoundException when add a prebuilt apk into system.img in android -