I have the following route for static files (yes, copied from the example!):
@cask.staticFiles("/static/file", headers = Seq("Cache-Control" -> "max-age=31536000"))
def staticFileRoutes(): String =
val r = Constants.outputDirectory
println(s"JLX: static folder returned: '$r'.")
r
When I use an output directory name (value of "Constants.outputDirectory" above) starting with one or multiple '/', the Cask framework strips the leading '/', resulting in a file not found error.
It took me a long time to figure out what was the error. I found it using strace, which shows clearly that the file that the web server tries to open does not start with the '/' character.
I have the following route for static files (yes, copied from the example!):
When I use an output directory name (value of "Constants.outputDirectory" above) starting with one or multiple '/', the Cask framework strips the leading '/', resulting in a file not found error.
It took me a long time to figure out what was the error. I found it using strace, which shows clearly that the file that the web server tries to open does not start with the '/' character.
strace output:
Thank you.