Reputation: 13
I have a host name and a port, set in env variable and I want my db.default.url to be like this,
db.default.url="jdbc:mysql://${DB_PORT_3306_TCP_HOST}:${DB_PORT_3306_TCP_PORT}/database_name"
But this doesn't workout.
Upvotes: 1
Views: 434
Reputation: 4823
I've never tried it myself but I guess it should look like this in the application.conf
:
db.default.url="jdbc:mysql://"${host}":"${port}"/database_name"
And you'd start your project with something like this:
/path/to/bin/<project-name> -Dport=1234 -Dhost=127.0.0.1
You can learn a lot about the schema of Play's config from this doc.
Upvotes: 2