문제

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?

도움이 되었습니까?

해결책

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

GET     /                           controllers.Application.cms(path="")
GET     /*path                      controllers.Application.cms(path)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top