# Introduction

Swift is our #1 language for mobile client side development on Android and iOS. However, a growing number of developers are using Swift on the server as well. To support this, we added Docker support to our IDE. Now you can easily code server applications and run them on Docker.

# Prerequisites

We currently support the following setup

  • Apple Mac OSX

  • XCode 10

  • Docker for Mac (latest version)

  • Swift 4.1 (Swift 4.2 few weeks away)

# Installation

  • Just make sure Docker for Mac is installed and running

# Running your Hello World server app

(Script tags will be stripped)

Here the steps to creating your first Hello World REST service

## Start SCADE IDE

## Create a new Swift Server project

a. Select File|New and choose Kitura Project

(Script tags will be stripped)

b. Specify the name of the server project and choose **Basic** type. Then press **Finish**.

(Script tags will be stripped)

c. The server project is created. Open the main file and you see a basic HTTP route implementation

(Script tags will be stripped)

import statement

As you can see, the import statement is marked as having an error. This message will disappear after compiling the project

## Compile project

a. Select the project Pick a project to compile. Use the project picker and select your project with Mac Docker as the target.

(Script tags will be stripped)

b. Select Docker on Mac

(Script tags will be stripped)

c. Press the compile button

When pressing the compile button, we download all docker images, sources and compile the project. Depending on your internet connection speed, this takes a while (2 - 10 minutes). However, this is only for the initial startup, after that, compilation and running the server app is immediate

(Script tags will be stripped)

d. After downloading and compiling, you see the final compilation output on the screen

(Script tags will be stripped)

First time, creating the project takes time

When you compile your server project for the first time, this will take some time (3-5 minutes), because a lot happens under the cover:

  • The Swift docker file is downloaded

  • The Server Framework is downloaded

  • The project is compiled

## Run your server app

a. Press the run button

(Script tags will be stripped)

b. You see the docker command for running your server!

(Script tags will be stripped)

c. Open your first server app on [http://localhost:8080](🔗)

Congratulation. Your first Swift server app is running on Docker

(Script tags will be stripped)