Does Play support separate routes files per environment - dev, uat, prod?

playframework

Solution

Yes it is possible. Declare your dev routes in `conf/routes`, but declare your production routes in `conf/prod.routes`. Then, have a production configuration file, `conf/prod.conf`, and put this in it:

include "application.conf"

application.router = "prod.Routes"

Now, when you start your application in production, simply use:

path/to/myapp/bin/myapp -Dconfig.resource=prod.conf -Dhttp.port=...

Problem

Is it possible to have the following routing in dev mode: ``` GET / controllers.Assets.at(path="/public/ui/dev", file="index.html") GET /*file controllers.Assets.at(path="/public/ui/dev", file) ``` and the following in production: ``` GET / controllers.Assets.at(path="/public/ui/prod", file="index.html") ```

Original source