June 2018
Intermediate to advanced
310 pages
6h 32m
English
Now we want to hold database configuration somewhere. For local development, it may be fine to have those configurations hardcoded.
When we connect to the database, we need to specify the following parameters at the very least:
Where should we store them?
One option is of course to hardcode those values. That would be fine for a local environment, but what about when deploying this service somewhere?
You'll go, I cant come! XDSpringBoot do, or we could attempt to read them from the environment variables. Anyway, we'll need an object that would encapsulate this logic, as shown in the following code:
object Config { object Db { val username = System.getenv("DATABASE_USERNAME" ...
Read now
Unlock full access