Reputation: 10180
I have two route like these:
GET /admin controllers.Application.admin()
GET /api/admin controllers.Application.admin()
can i define somthing like this in Play framework 2?
GET /admin /api/admin controllers.Application.admin()
Upvotes: 0
Views: 1038
Reputation: 27
You can try something like GET /*res controllers.Application.admin(res)
and in controllers you can write def admin(res:String)= { something like this } in scala we do this.
Upvotes: 0
Reputation: 55798
No it's not possible, actually the same action shouldn't have two different routes (also from SEO point of view), therefore best practice is creating a redirect from one of them pointing the other one.
Upvotes: 1