尝试 运行 Scala Play 示例时出错
Error when trying to run Scala Play examples
我正在尝试学习 Play for scala,尽管它们提供了一些很好的示例项目,但我无法将它们中的任何一个都学成 运行。特别是其余 api 示例 https://github.com/playframework/play-samples/tree/2.7.x/play-scala-rest-api-example
据说你可以只下载示例和 运行 sbt run
。该项目为我构建得很好,但是当我导航到项目的 url、localhost:9000
时,出现错误:
[info] play.api.Play - Application started (Dev) (no global state)
[debug] a.ErrorHandler - onClientError: statusCode = 404, uri = /, message =
没有别的,只有 404,google 没有提供任何关于可能发生的事情的线索。寻找对这可能是什么的任何见解。
无论如何,我不会修改示例项目。我已经尝试了 Play 2.8 和 2.7 示例。
您启动的示例项目没有为 /
定义路由,只定义了 /v1/posts
下的一些路由(您可以在 routes
文件中查看)。
也许最好从名为“play-scala-starter-example”的示例项目开始(它在 /
上定义了一条路线):https://github.com/playframework/play-samples/tree/2.7.x/play-scala-starter-example
我正在尝试学习 Play for scala,尽管它们提供了一些很好的示例项目,但我无法将它们中的任何一个都学成 运行。特别是其余 api 示例 https://github.com/playframework/play-samples/tree/2.7.x/play-scala-rest-api-example
据说你可以只下载示例和 运行 sbt run
。该项目为我构建得很好,但是当我导航到项目的 url、localhost:9000
时,出现错误:
[info] play.api.Play - Application started (Dev) (no global state)
[debug] a.ErrorHandler - onClientError: statusCode = 404, uri = /, message =
没有别的,只有 404,google 没有提供任何关于可能发生的事情的线索。寻找对这可能是什么的任何见解。 无论如何,我不会修改示例项目。我已经尝试了 Play 2.8 和 2.7 示例。
您启动的示例项目没有为 /
定义路由,只定义了 /v1/posts
下的一些路由(您可以在 routes
文件中查看)。
也许最好从名为“play-scala-starter-example”的示例项目开始(它在 /
上定义了一条路线):https://github.com/playframework/play-samples/tree/2.7.x/play-scala-starter-example