user3418832 user3418832 - 10 months ago 36
Java Question

custom base path play framework

Is there a way to configure a custom root base path for all the routes?

for example:


but I want to prepend everything with:


anyway to do it via a application.conf?


Yes. Suppose your routes file has the following routes

GET /login  controllers.login()
GET /user   controllers.user()
GET /group

To achieve what you want, you just have to rename or move that rules to a new file (for example v1.routes) and then in the main routes file, use

->      /v1     v1.Routes

All the routes present in v1 file are now prepended with v1