Server Side Swift with Vapor: Basic Controllers | Ray Wenderlich

In this screencast, you'll learn how to create basic controller objects to organize the routes for your web apps.

This is a companion discussion topic for the original entry at

Great screencast, Ray!

Waiting for a authorization screencast.
Please, cover how to build a simple and secure authorization for mobile clients and how to access a protected resource.


Nice! Exactly what I needed. I’m a first time backend developer after some dabbling with RoR 12 years ago.
What would be a nice addition to these SSS screencasts, IMHO, is how to provide proper unit tests for all these handlers.
But other topics, like middleware, authentication and error handling are more important.

Is there a reason you are not using RouteCollection?

@sadiq81 Actually I wasn’t even aware of RouteCollection before you mentioned it. Looking at it, I’m unsure what advantage it has over adding a simple addRoutes() method like I did in the screencast. Any thoughts?

At the moment one reason i can see as that its more specialized, you only have access to a route builder and not the droplet, so you won’t get tempted to add droplet related code inside. Perhaps in the future it will have more functions.

Great Video Ray. Thanks, from Peru!

@sadiq81 Good point! Thanks for bringing it to my attention.

@keyner Thanks! :]