Akka HTTP:找不到请求的资源

时间:2018-03-14 15:10:46

标签: java akka-http

我在Akka HTTP中使用Akka HTTP "Minimal Example"作为我的第一步。

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

现在我想向resources/web/test.html添加路线,类似于"Directives"页面上的示例:

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

但是http://localhost:8080向我展示了以下内容:

The requested resource could not be found.

0 个答案:

没有答案