Created
February 10, 2020 13:30
-
-
Save plavjanik/feadcff4c1a25100d6edf324990bc2d2 to your computer and use it in GitHub Desktop.
Simple HTTP server in Swift for z/OS
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 | |
| let router = Router() | |
| router.get("/") { request, response, next in | |
| response.send("Hello world!") | |
| next() | |
| } | |
| Kitura.addHTTPServer(onPort: 10055, with: router) | |
| Kitura.run() |
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
| // swift-tools-version:4.0 | |
| import PackageDescription | |
| import Foundation | |
| guard let kituraRoot = ProcessInfo.processInfo.environment["KITURA_ROOT"] else { | |
| fatalError("KITURA_ROOT must be present") | |
| } | |
| let package = Package( | |
| name: "HelloKitura", | |
| dependencies: [ | |
| .package(url: "\(kituraRoot)/Kitura", .branch("master") ) | |
| ], | |
| targets: [ | |
| .target(name: "HelloKitura", dependencies: ["Kitura"]), | |
| ] | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment