O'Reilly logo

RESTful Web Services with Scala by Jos Dirksen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Your first Scalatra service

To get our first Scalatra service up and running, we need to take a couple of extra steps. The reason is that Scalatra is designed to run in a servlet container (for example, Tomcat or Jetty). While this works great for test and production environments, it doesn't allow us to do some quick prototyping or easily run from SBT or an IDE. Luckily, you can also start the Jetty servlet container programmatically and run your Scalatra service from there. So, in this section, we'll:

  • Start by showing you the dependencies required to run Scalatra
  • Setting up Jetty in such a way that it can run our Scalatra REST service
  • Creating a simple Scalatra service that responds to a specific GET request

First, let's look at the dependencies ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required