Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
418 views
in Technique[技术] by (71.8m points)

database - Hide db property variables Spring Boot Heroku

I have my database set up in heroku and have created my Config Vars to hide my DB credentials. I believe this will all work when my app is deployed, but for development, I'm stuck with an application.properties that looks like :

spring.datasource.url=DB_URL
spring.datasource.username=DB_USERNAME
spring.datasource.password=DB_PASSWORD

Obviously, this will not work when I'm trying to test things.

How can I set it up so that the spring.datasources will have the proper configuration details when I'm developing and testing but then the config vars when pushed to Heroku?

If it helps to see where my head is at, I am used to working with dotenv with Node.js and looking for something similar for java.

Or am I going about this the wrong way? How can I set this up so it will work when deployed on heroku and when I am working on it locally?

Thanks!

question from:https://stackoverflow.com/questions/65908416/hide-db-property-variables-spring-boot-heroku

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...