I'm trying to serve my html, css and js with akka http:
path("") {
get {
getFromResourceDirectory("home")
complete(HttpEntity(ContentTypes.`text/html(UTF-8)`, home.render().toString()))
}
}
home.render()
is a twirl template that renders:
<html>
<head>
<link rel="stylesheet" href="home.css">
<script src="home.js"></script>
</head>
<body>
...
</body>
</html>
The html loads without problem except for the css and js files, this is my dir structure:
GET http://localhost:8080/home.js net::ERR_ABORTED
localhost/:5 GET http://localhost:8080/home.css net::ERR_ABORTED