Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Route URLs in Play 2.0 so They're Indifferent to an Ending Slash

Can I capture the following two routes in a single line?

GET     /game                    controllers.Main.app.gamelist
GET     /game/                   controllers.Main.app.gamelist
like image 200
Jacob Groundwater Avatar asked Apr 04 '12 04:04

Jacob Groundwater


2 Answers

This is currently not supported and a ticket has been submitted to the issue tracker. There is also a discussion regarding this (including some workarounds) on Google Groups.

Hopefully this will be implemented in some smart way soon.

like image 186
Franz Avatar answered Sep 28 '22 04:09

Franz


If you are using playframework 1.x then it is:

GET /game/? controllers.Main.app.gamelist
like image 32
Gelin Luo Avatar answered Sep 28 '22 04:09

Gelin Luo