 
 # Necessary
 pathUtil = require('path')
+fsUtil = require('fs')
 _ = require('underscore')
 caterpillar = require('caterpillar')
 CSON = require('cson')

		config = @config
		server = null

		# Handlers
		complete = (err) ->
			return next(err)  if err

							server.use(express.static config.outPath)

						# 404 Middleware
						server.use (req, res, next) ->
							notFound = 404
							code = findClosest(notFound)
							if errorFiles.hasOwnProperty(code) && pathUtil.existsSync errorFiles[code]
								data = fsUtil.readFileSync(errorFiles[code], 'utf8')
							else
								data = notFound + ' ' + errorCodes[notFound]

							return res.send(data, notFound)

						# 500 Middleware
						server.use (err, req, res, next) ->
							# Assume 500 for now
							serverError = 500
							code = findClosest(serverError)
							if errorFiles.hasOwnProperty(code) && pathUtil.existsSync errorFiles[code]
								data = fsUtil.readFileSync(errorFiles[code], 'utf8')
							else
								data = serverError + ' ' + errorCodes[serverError]

							return res.send(datam serverError)

				# Start the Server
				startServer()
