Simple Hello World Kitura Application (Server Side) embedded in an iOS app (Client Side). The app demonstrates starting and stopping Kitura server, and presents Kitura log on the screen.
- Enable Server-Side Swift with Kitura - see http://www.kitura.io/en/starter/settingup.html
- Install Xcode Command Line Tools by running
xcode-select --install
command in the terminal - Run
make Builder/Makefile
- it will fetch theBuilder
submodule (and also theServerSide
submodule) - Create an iOS static library for
curl
package. Download curl zipped source from https://curl.haxx.se/download/, unzip it and runBuilder/buildCurlStaticLibrary.sh <path to the unzipped curl source directory>
. For example, if you unzip curl in the current directory, incurl-7.43.0
directory, runBuilder/buildCurlStaticLibrary.sh curl-7.43.0
.
We tested working with curl 7.43.0 version.
- Type
make
in the terminal, an Xcode instance with a workspace will be opened. The workspace will contain both the client-side and the server-side parts as projects. You should rerunmake
any time you change the structure ofServerSide
- add a file or add a dependency. - In the opened Xcode workspace, you can edit the code, both the client-side and server-side parts, debug and run the client-side iOS app (
ClientSide
) with the server side embedded in it.
You will see the URL of your Kitura/iOS server in the start screen of the app. Start the server by flipping the switch "STOPPED" on. Use another device (any OS) on the same Wi-Fi network. Point a browser in the other device to the displayed URL, you should get "Hello World!" message with a timestamp as a response. Alternatively, use the QR code displayed beside the URL of the server.