Created
December 31, 2016 20:31
-
-
Save matteocrippa/3cc9c51df6b6f750c05f9e3864f48567 to your computer and use it in GitHub Desktop.
Kitura Hello World
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Kitura | |
| // Create a new router | |
| let router = Router() | |
| // Handle HTTP GET requests to / | |
| router.get("/") { | |
| request, response, next in | |
| response.send("Hello, World!") | |
| next() | |
| } | |
| // Add an HTTP server and connect it to the router | |
| Kitura.addHTTPServer(onPort: 80, with: router) | |
| // Start the Kitura runloop (this call never returns) | |
| Kitura.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment