@babloo80 wrote:
Hello there,
I am trying to host a local filepath resource into http using
getFromBrowseableDirectories
directive.import akka.actor.ActorSystem import akka.http.scaladsl.Http import akka.http.scaladsl.server.Directives._ object Test1 { def main(args: Array[String]): Unit = { implicit val act = ActorSystem("act1") val route = { path("entries") { getFromBrowseableDirectories("/tmp/dir1") } } Http().bindAndHandle(route, "0.0.0.0", 8000) } }
It seems to show up the directory listing (
/tmp/dir1
using http://localhost:8000/entries) containing directories and files correctly. But, any attempt toGET
on a file or on a directory inside/tmp/dir1
fails with aHTTP/1.1 404 Not Found
.
I intend to provide recursiveGET
support for/tmp/dir1
.
On a side note, I am able to surfaceindividual files
usinggetFromFile
directive. Perhaps I have to build a recursivepath
directive withgetFromFile
&getFromBrowseableDirectories
?Please advice,
Muthu
Posts: 1
Participants: 1