       console.log 'Server running at: ', _server.info.uri
       return _server
 
+  # Private: Sets up tls configuration needed for https server
+  #
+  # Returns the configuration object for Hapi server.
   _configureServerOptions = ->
     tlsOptions = []
 


    { tls: tlsOptions, files: files }

  _generateCert = ->
    cert = keypair
      name: "localhost"

      _Hapi ?= require 'hapi'
    Promise.promisifyAll(_Hapi.Server.prototype)

  # Public: returns private property _server
  #
  # Returns the _server as `undefined`.
  getServer: ->
    _server

  # Public: stops a running server
  #
  stop: ->
    _server?.stop()
    console.log 'Server stopped'

  # Public: Starts the server
  #
  # Returns the the underlying server engine as a promise.
  start: ->
    # create new server
    options = _configureServerOptions()
