<commit_before>![Kitura](https://raw.githubusercontent.com/IBM-Swift/Kitura/master/Documentation/KituraLogo.png)

![Linux](https://img.shields.io/badge/os-linux-green.svg?style=flat)
![Mac OS X](https://img.shields.io/badge/os-Mac%20OS%20X-green.svg?style=flat)
![Apache 2](https://img.shields.io/badge/license-Apache2-blue.svg?style=flat)
[![Join the chat at https://gitter.im/IBM-Swift/Kitura](https://badges.gitter.im/IBM-Swift/Kitura.svg)](https://gitter.im/IBM-Swift/Kitura?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

**Server Side Swift example with InstaTrip API based on IBM Kitura**

This example is based on the Bluemix starter application for IBM Kitura web framework and HTTP server.
Below you would find:
- the sample Swift server side code;
- playing with Swift in the Swift Sandbox!
- it is enough to just click to deploy the Swift Server Side app on IBM Bluemix cloud;
- you might edit the code, redeploy, and check the logs direct from your browser;
- further reading, and my blog, of course.

##The Swift Server Side Sample
The Swift sample code for IBM Kitura Web Server used in our example is based on the following API response with the JSON message:

```Swift
import Kitura

let router = Router()

// getting the 'cognitive' travel arrangements for Hawaii
router.get("/HNL") {
    request, response, next in
    response.send("{price : '$670'," + " trip : 'Round Trip'," + " FROM : 'SFO', TO : 'HNL'}")
    next()
}

Kitura.addHTTPServer(onPort: 8090, with: router)<commit_msg>added video<commit_after>![Kitura](https://raw.githubusercontent.com/IBM-Swift/Kitura/master/Documentation/KituraLogo.png)

![Linux](https://img.shields.io/badge/os-linux-green.svg?style=flat)
![Mac OS X](https://img.shields.io/badge/os-Mac%20OS%20X-green.svg?style=flat)
![Apache 2](https://img.shields.io/badge/license-Apache2-blue.svg?style=flat)
[![Join the chat at https://gitter.im/IBM-Swift/Kitura](https://badges.gitter.im/IBM-Swift/Kitura.svg)](https://gitter.im/IBM-Swift/Kitura?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

**Server Side Swift example with InstaTrip API based on IBM Kitura**

This example is based on the Bluemix starter application for IBM Kitura web framework and HTTP server.
Below you would find:
- the sample Swift server side code;
- playing with Swift in the Swift Sandbox!
- it is enough to just click to deploy the Swift Server Side app on IBM Bluemix cloud;
- you might edit the code, redeploy, and check the logs direct from your browser;
- further reading, and my blog, of course.

[![youtube from blumarek.blogspot.com](https://1.bp.blogspot.com/-u2XJZAW2hqU/V2MRaDaZ5pI/AAAAAAAAAso/ou44nbsT9ekis65S7menOg6q45wb-g2nwCLcB/s1600/Screenshot%2B2016-06-16%2B13.51.39.png)](https://youtu.be/Rok6545sqHs)
Check the video on the explanations

##The Swift Server Side Sample
The Swift sample code for IBM Kitura Web Server used in our example is based on the following API response with the JSON message:

```Swift
import Kitura

let router = Router()

// getting the 'cognitive' travel arrangements for Hawaii
router.get("/HNL") {
    request, response, next in
    response.send("{price : '$670'," + " trip : 'Round Trip'," + " FROM : 'SFO', TO : 'HNL'}")
    next()
}

Kitura.addHTTPServer(onPort: 8090, with: router)
{'fraction_non_alphanumeric': 0.12824381412190705, 'fraction_numerical': 0.019613759806879905, 'mean_word_length': 4.877659574468085, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 16, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5023399', 'n_tokens_mistral': 1204, 'n_tokens_neox': 1106, 'n_words': 321}