 
 fs = require "fs"
 path = require "path"
+http = require "http"
+https = require "https"
 
 _ = require "underscore"
 express = require "express"

  localURL.server = server
  localURL.protocol = (if (useHTTPS) then "https" else "http")

  if useHTTPS
    app = express.createServer(
      key: fs.readFileSync(config.key)
      cert: fs.readFileSync(config.cert)
    )
    bounce = express.createServer((req, res, next) ->
      host = req.header("Host")
      res.redirect "https://" + host + req.url, 301
    )
  else
    app = express.createServer()

  # Configuration
  app.set "views", path.join __dirname, "..", "views"

        if useHTTPS
          Step(
            () ->
              appServer.listen config.port, address, this.parallel()
              bounce.listen 80, address, this.parallel(),
            (err) ->
              cb(err, app, bounce)
