I'm trying to learn Play for scala and though they provide some nice example projects, I can't get any of them to run. Specifically the rest api example https://github.com/playframework/play-samples/tree/2.7.x/play-scala-rest-api-example
Supposedly you can just download the sample and run sbt run
. The project builds for me just fine, but when I navigate to the url, localhost:9000
for the project I get error:
[info] play.api.Play - Application started (Dev) (no global state)
[debug] a.ErrorHandler - onClientError: statusCode = 404, uri = /, message =
nothing else, just a 404, google is not providing any clues as to what could be going on. Looking for any insight into what this could be. I'm not modifying the sample project in anyway. i've tried both the Play 2.8 and 2.7 examples.
The example project you started from doesn't define a route for /
but only some routes under /v1/posts
(you can check this in the routes
file).
Maybe it's better to start with the sample project called "play-scala-starter-example" (which does define a route on /
): https://github.com/playframework/play-samples/tree/2.7.x/play-scala-starter-example