Domanda

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?

È stato utile?

Soluzione

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

GET     /                           controllers.Application.cms(path="")
GET     /*path                      controllers.Application.cms(path)
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top