I am working on a Play Framework 2.2 application that serves both a JSON api and a single-page application. For the single-page app, I am using Backbone.js, and I would like to support the HTML5 History api.
Currently, Play is serving the single-page app via an index.html file, and all routing in the single-page app is done with hash-based routing. Below is the route that I am using:
GET /app/*file controllers.Assets.at(path="/public/app/src", file)
And a sample URL that is handled by the single-page app is:
/app/index.html#/some/url
I would like to be able to route all URLS that begin with /app/
to my index.html file, so that the above URL would become the following and would still be handled by my index.html file:
/app/some/url
My idea was to use a route like the following:
GET /app/*anything controllers.Assets.at(path="/public/app/src", file="index.html")
However, Play is not happy with me not using the "anything" route, so I get the following compilation error: Missing parameter in call definition: anything.
Is there any way in Play 2 to have a "wildcard" route like the one above route to a single, static file?