Created
November 18, 2016 23:41
-
-
Save siavashalipour/c0c65f5e476f4e7127ae72e8e436e39c to your computer and use it in GitHub Desktop.
End-to-end Swift Solution with IBM Bluemix Part one - 3
This file contains 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 Foundation | |
import Kitura | |
import LoggerAPI | |
import HeliumLogger | |
import CloudFoundryEnv | |
import CloudFoundryDeploymentTracker | |
do { | |
// HeliumLogger disables all buffering on stdout | |
HeliumLogger.use(LoggerMessageType.info) | |
let controller = try Controller() | |
Log.info(“Server will be started on ‘\(controller.url)’.”) | |
CloudFoundryDeploymentTracker(repositoryURL: “https://github.com/siavashalipour/Microservice1.git", codeVersion: nil).track() | |
Kitura.addHTTPServer(onPort: controller.port, with: controller.router) | |
// Start Microservice1 server | |
Kitura.run() | |
} catch let error { | |
Log.error(error.localizedDescription) | |
Log.error(“Oops… something went wrong. Server did not start!”) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment