Ccuhzzoe6ukismvwasda
SkillsCast

Beyond URL Matching: Mastering the Spray/Akka-Http Routing DSL

8th December 2014 in London at Business Design Centre

There are 54 other SkillsCasts available from Scala eXchange 2014

Please log in to watch this conference skillscast.

499431324 640

Most REST frameworks can match request URIs and then pass the raw request to some kind of handler function. But is that really enough? Spray's routing DSL is an incredibly powerful toolkit for writing high-performance REST APIs. It takes care of every aspect of Http request handling and response building in an elegant, readable, and highly functional way. But as the saying goes (sort of): with great power comes a great learning curve!

This session will start with an introduction to the Spray/Akka-http routing DSL, making sure to go beyond the basics. It will also show examples of real-world application code to give you a feeling for what the end result looks like. The session will conclude with a discussion of some things to watch out for on your way to becoming an expert user.

Overview:

-The routing DSL
-Real world examples
-Things to watch out for

Detailed Contents:

-The routing DSL
-An overview of the builtin directives.
-Combining directives into route handlers
-Marshalling and unmarshalling your (case) classes
-Dealing with rejection
-Dealing with Futures
-Writing your own directives

Real world examples

-A simple OAuth2 server

Things to watch out for
- Confusing errors
- If you block, things break

YOU MAY ALSO LIKE:

Thanks to our sponsors

Beyond URL Matching: Mastering the Spray/Akka-Http Routing DSL

Age Mooij

Age Mooij discovered Scala in 2009 after many years of Java development. In that same year he founded the Dutch Scala Enthusiasts user group and started giving Scala Labs workshops.