Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Play! Framework Route Wildcard for root address

I'm using Backbone for a SPA, and I'm using its router as well. I need to set a wildcard in the routes file of my application for the back-end, but I can't figure out how to set it for the ROOT URL. I've tried GET /*path controllers.Application.cms(path) but it doesn't work if I navigate to localhost:9000. Also, GET *path controllers.Application.cms(path) with the slash omitted is not a valid route. Is there any way I can set a wildcard to catch all uncaught routes?

like image 748
Melvin Sowah Avatar asked Oct 15 '25 19:10

Melvin Sowah


1 Answers

Define an additional route before /*path in the config/routes:

GET     /                           controllers.Application.cms(path="")
GET     /*path                      controllers.Application.cms(path)
like image 143
Alex Zolotko Avatar answered Oct 17 '25 09:10

Alex Zolotko