for Nyemils website



Vapor Example

Fork this example project as a boilerplate for working with Vapor.

Check out the live demo running on Ubuntu.


Build Status PRs Welcome Slack Status


View Vapor for documentation.


Swift 2.2 or later is required (3.0 or later for certain features).

Works on Ubuntu, Docker, Heroku, OS X


Swift 2.2

Visit Getting Started in the Vapor Wiki for more details about using Swift 2.2.

Swift 3.0

Check out Kylef's swiftenv for ensuring you have the latest version of Swift installed. This project contains a .swift-version file which will tell swiftenv which version of Swift to build with automatically.

If you dont want to use swiftenv, visit to learn more about installing development snapshots on your system.

Vapor CLI

The Vapor Command Line Interface makes it easy to build and run Vapor projects. Install it on Mac by running

brew tap qutheory/tap
brew install vapor
vapor help

or on Linux with

git clone
cd vapor
sudo cp vapor /usr/local/bin/vapor
cd ../
rm -rf vapor
vapor help


If you have the Vapor CLI, use vapor new <project-name> to create your new application.

Then run vapor build and vapor run.

Otherwise, clone this repo and run swift build to compile your application, then run .build/debug/App.

Xcode 7.3

Open the VaporApp.xcodeproj with Xcode 7.3 and make sure Xcode > Toolchains is set to swift-DEVELOPMENT-SNAPSHOT-2016-03-24-a.xctoolchain or later.



Check the Vapor documentation for more in-depth deployment instructions.


To start your Vapor site automatically when the server is booted, add this file to your server.


description "Vapor Example"

start on startup

exec /home/<user_name>/vapor-example/.build/release/App --workDir=/home/<user_name>/vapor-example

You additionally have access to the following commands for starting and stopping your server.

sudo stop vapor-example
sudo start vapor-example

The following script is useful for upgrading your website.

git pull
swift build --configuration release
sudo stop vapor-example
sudo start vapor-example

Heroku /

Deploy to


You can run this demo application locally in a Linux environment using Docker.

  1. Ensure Docker is installed on your local machine.
  2. Start the Docker terminal
  3. cd into vapor-example
  4. Build the container docker build -t vapor .
  5. Run the container docker run -it -p 8080:8080 vapor
  6. Configure VirtualBox to forward ports 8080 to 8080
  7. Visit

Nginx / Supervisor

You can also run your Vapor app through Nginx. It’s recommended you use Supervisor to run the app instance to protect against crashes and ensure it’s always running.


To setup Vapor running through Supervisor, follow these steps:

apt-get install -y supervisor

Edit the config below to match your environment and place it in /etc/supervisor/conf.d/your-app.conf:

command=/path/to/app/.build/release/App serve --ip= --port=8080

Now register the app with Supervisor and start it up:

supervisorctl reread
supervisorctl add your-app
supervisorctl start your-app # `add` may have auto-started, so disregard an “already started” error here


With the app now running via Supervisor, you can use this sample nginx config to proxy it through Nginx:

server {
    listen 80;

    root /path/to/app/Public;

    # Serve all public/static files via nginx and then fallback to Vapor for the rest
    try_files $uri @proxy;

    location @proxy {
        # Make sure the port here matches the port in your Supervisor config
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_connect_timeout 3s;
        proxy_read_timeout 10s;