     # for HTML or */* ... ex: /foo/bar to build/foo/bar.html
     @app.use (request,response,next) ->
       accept = request.headers["accept"]
-      if ( request.method == "GET" ) and 
-      ( accept.match( /html/ ) or accept == "*/*" )
-        path = resolve( webPath, request.url[1..] )
+      console.log "ACCEPT", accept
+      if ( request.method == "GET" ) and accept.match( /text\/html/ )
+        path = join( webPath, request.url[1..] )
         async.detect [
-          resolve( path, "index.html" )
+          join( path, "index.html" )
           "#{path}.html"
           ], isFile, (path) ->
             # If we found a file, then stream it in the response;
             # otherwise, just return /index.html and let the client-side
             # app figure out what to do with the path
-            if path? and ( stream = FileSystem.createReadStream( path ) )?
-              stream.pipe( response )
+            if path?
+              streamResponse( response, path )
               response.setHeader("content-type","text/html")
             else
-              path = resolve( webPath, "index.html" )
-              stream = FileSystem.createReadStream( path )
-              if stream?
-                stream.pipe( response )
-                response.setHeader("content-type","text/html")
-              else
-                log.error "Unable to read from /index.html"
-              
+              path = join( webPath, "index.html" )
+              FileSystem.exists path, (exists) ->
+                if exists?
+                  streamResponse( response, path )
+                  response.setHeader("content-type","text/html")
+                else
+                  log.error "Error: Missing /index.html"
+                  response.statusCode = 500
+                  response.end()
       else
         next()
     

    log.info "#{response.statusCode} #{request.method} #{request.url}"
  next()

class Server

  constructor: (options) ->

connect = require("connect")
FileSystem = require "fs"
{resolve,join} = require "path"
async = require "async"

isFile = (path, callback) ->
