Created
March 20, 2017 22:16
-
-
Save candostdagdeviren/19c0d044d6e2caee824f9b30befd180f to your computer and use it in GitHub Desktop.
SwiftBackend file inside SwiftBackendLib module.
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 Kitura | |
import HeliumLogger | |
import CouchDB | |
public class SwiftBackend { | |
public static func run() { | |
HeliumLogger.use() | |
let connProperties = ConnectionProperties( | |
host: "127.0.0.1", // httpd address | |
port: 5984, // httpd port | |
secured: false, // https or http | |
username: "candost", // admin username | |
password: "password" // admin password | |
) | |
let db = Database(connProperties: connProperties, dbName: "kitura_test_db") | |
let databaseInteraction = DatabaseInteraction(db: db) | |
let app = MainRouter(db: databaseInteraction) | |
Kitura.addHTTPServer(onPort: 8090, with: app.router) | |
Kitura.run() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment