user1058323
user1058323

Reputation: 69

Configuration Variables in Play! Framework

I am new to Play!, and wrote my first application. This app has a set of URL's it depends of, to pull data from and also to return valid URLs on the XML responses.

This app needs to run in different environments (Dev, Staging and Prod), and each environment will require its own set of URLs.

I guess the place to define this set of URLs is in the application.conf file. However I don't seem to find out how, and later access them through the normal classes.

As a related point, I don't want to use Framework IDs as we will deploying this as a WAR, and it will be easier to have an instance of the aplication.conf file per environment.

Upvotes: 6

Views: 7730

Answers (1)

Codemwnci
Codemwnci

Reputation: 54914

Check out this post - Playframework route file: Separate Production routes from Dev routes

Take the approach in that post, but rather than using Play.mode.isDev(), use the configuration, such as Play.configuration.get('item-from-app-conf')

Upvotes: 5

Related Questions