Appendix

Requirements

You will need a JDK 1.8 that is more recent than b20. You can download the JDK from here.

You will need to have git installed.

Downloading

You can download the example project from Github:

git clone https://github.com/playframework/play-rest-api.git

Running

You need to download and install sbt for this application to run. You can do that by going to the sbt download page and following the instructions for your platform.

Once you have sbt installed, the following at the command prompt will download any required library dependencies, and start up Play in development mode:

sbt run

Play will start up on the HTTP port at http://localhost:9000/. You don’t need to reploy or reload anything – changing any source code while the server is running will automatically recompile and hot-reload the application on the next HTTP request. You can read more about using Play here.

Usage

If you call the same URL from the command line, you’ll see JSON. Using httpie, we can execute the command: