9

I'm using the Akka HTTP "Minimal Example" for my first steps in Akka HTTP.

private Route createRoute() {
  return route(
    path("hello", () ->
      get(() ->
        complete("<h1>Say hello to akka-http</h1>"))));
}

Now I want to add a route to my resources/web/test.html, similar to an example on the "Directives" page:

private Route createRoute() {
  return route(
    pathSingleSlash(() ->
      getFromResource("web/test.html")
    ),
    path("hello", () ->
      complete("<h1>Say hello to akka-http</h1>")));
}

But http://localhost:8080 is showing me the following:

The requested resource could not be found.
Jeffrey Chung
  • 19,319
  • 8
  • 34
  • 54
Thane
  • 91
  • 3

0 Answers0