0

My Play 2.0 application runs under different directories during development and in production:

During dev we use /, in production it runs as /crm/.

Is it possible to define a "root directory" of some sort for play?

This article suggests using the isDev() sort of methods and this one to use a config variable, but it seems like the routes file no longer allows code inclusion: adding %{ }—style tags to the routes file results in compilation errors.

Community
  • 1
  • 1
Fabian Streitel
  • 2,220
  • 22
  • 35

2 Answers2

0

In 2.0 or 2.0.1 you can't do it.

If you use the trunk-version you can define a property:

application.context="/AwesomePlayApplication"

This property can be set by in the usual way at production. But this is only possible with the future version.

niels
  • 7,144
  • 2
  • 33
  • 56
0

As there seems to be no other solution, I decided to go with a shell script that modifies the routes file on deployment and adds the necessary prefix to every route.

Fabian Streitel
  • 2,220
  • 22
  • 35