Protocol Buffers – Vapor Web Server
This is one of two backends I created for experimenting with protocol buffers. The Vapor server is a little heavier than Perfect by default, as it is configured by default to be a fully-fledged web server for HTML/CSS/JS. In practice, though, this only amounts to an extra 0.5MB of memory usage and a bit longer compile time. Documentation for Vapor is more robust than Perfect, and it is easy to get a new project started using the Vapor Toolbox command line tools. You would just need to add the Protocol Buffers dependency to the Package.swift file.
See also: Protocol Buffers – Perfect Web Server
See also: Client iOS App
Already have Swift? Jump to Install Server.
- Open a terminal.
brew install swiftenv.
- Don't have homebrew? Installation instructions here.
- Install Swift using swiftenv:
swiftenv install 3.1.1
- Clone this repository.
- Open terminal in the directory you just created.
- Compile the server:
Running the Server
- In the same directory you just built from:
- You should see a message stating that the server has started at
- Press Control-C to quit the server.