-
-# TODO: Support custom "500 Internal Error" page.
 
 assertTypes = require "assertTypes"
 assertType = require "assertType"

  _server: createServer options, onRequest.bind this

  _timeout: options.timeout

# The root request handler.
onRequest = (req, res) ->

  log.gray (now() - req.timestamp).toFixed(3) + "ms"
  log.moat 0
  return

# The default handler when the server throws an error.
handle500 = (error, res) ->

  log.moat 1
  log.white error.stack
  log.moat 1

  res.status 500
  res.send {error: "Something went wrong on our end. Sorry!"}
  return
