Building servers using Vapor's engine

Before we start using Vapor, let's see how the Vapor package is built on top of its engine package. This will give us a better understanding of what, exactly, Vapor provides, and what is provided by the dependencies that it consumes, in case you need to build a lightweight server or want to embrace building your own variation of a web framework. We will do the following:

  1. First, build a basic web server that returns Hello World
  2. Then, modify our Hello World server to serve file content, making a static file server similar to Apache or Nginx
  3. Lastly, we will build a web socket server that will accept connections and echo back the message sent via the web socket connection

Going through the exercise of building ...

Get Hands-On Full-Stack Development with Swift now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.