I\'m trying to make a route to a specific static file but everything I\'m trying ends with an error.
I\'ve made 3 different attempts:
1.
GET /fil
The solution to this that is cleanest is to create your own AssetsBuilder that will build your static page.
Create this file in your controllers package - Static.scala
package controllers
object Static extends AssetsBuilder
Then in your routes you can define your static endpoint
GET /file controllers.Static.at(path="/public/html", "file.html")
Done. Now the file at /public/html/file.html
will be served off of localhost:9000/file
If you replace the hard code above with a more generic:
GET /*file controllers.Static.at(path="/public/html", *file + ".html")
then /foo
will serve /public/html/foo.html
, /bar
will serve /public/html/bar.html
etc.