我在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.