main.swift 468 B

12345678910111213141516171819
  1. //
  2. // main.swift
  3. // SwifterOSX
  4. // Copyright (c) 2015 Damian Kołakowski. All rights reserved.
  5. //
  6. import Foundation
  7. do {
  8. let server: HttpServer = demoServer(try File.currentWorkingDirectory())
  9. server["/testAfterBaseRoute"] = { request in
  10. return .OK(.Html("ok !"))
  11. }
  12. try server.start(9080)
  13. print("Server has started ( port = 9080 ). Try to connect now...")
  14. NSRunLoop.main().run()
  15. } catch {
  16. print("Server start error: \(error)")
  17. }