MongoDB Connection for Spring Boot Application on Heroku -


what best way configure spring boot application connect mongodb on heroku? got working specifying spring.data.mongodb.uri in application.properties file, set connection up, can keep application pointing local mongodb during development, while being able push heroku without reconfiguring connection uri each time.

thanks, jerry

you use profile-specific configuration specify uris use during development , when deploying heroku. file named application-{profile}.properties loaded when matching profile active, i.e. use file named application-heroku.properties , enable heroku profile when deploying heroku. profile-specific configuration override default configuration in application.properties. can enable profile using spring.profiles.active, example:

java -jar your-app.jar --spring.profiles.active=heroku 

Comments

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -