I am using Finatra 2.1.6 with this code:
get("/:*") { request: Request =>
response.ok.fileOrIndex(
request.params("*"),
"index.html")
}
If I run this from e.g. IntelliJ, it works perfectly fine and displays the html file. However, if I start the server from an assembled jar (using sbt assembly
), it does not: Whenever I try to access index.html, which I put in src/resources/index.html
, it tries to download the file since the contentType is set to application/octet-stream
instead of e.g., text/html
.
How can I change the behaviour so it renders the html file (or css, js,...) rather than downloading it?