 fs = require 'fs'
 
 app = express()
-
 
 ###
 	Configuration

			stream.on 'error', (error) ->
				console.error "SPDY stream error while pushing template: #{templateName}", error

			templateFile = templateName + '.jade'
			fs.readFile app.get('views') + templateFile, (err, data) ->
				if err?
					console.error "Error while pushing template: #{templateName}. Error: ", err
					return

				templateFunc = require('jade').compile(data)
				stream.end templateFunc(locals = {})
	catch error
		console.error "Error while pushing template: #{templateName}. Error: ", error


app.get "/", (req, res) ->
	if res.isSpdy and res.push?
		pushAsset asset, res for asset in config.assets
		pushTemplate 'partials/map', req, res
	routes.index(req, res)

app.get "/partials/:name", routes.partials
