       for pkg, filenames of @assets.js
         for filename in filenames
           if req.url.replace(/^\/assets\/|.(?!.*\.).*/g, '') is filename.replace(/.(?!.*\.).*/, '')
-            contents = fs.readFileSync(path.resolve process.cwd() + '/' + filename).toString()
+            contents = fs.readFileSync(path.resolve @appDir + '/' + filename).toString()
             contents = preprocess contents, filename
             res.end contents
             return

# Goes through asset declarations and expands them into full file paths, globs and all.
expandAssetGlobs = =>
  assets = {js: {}, css: {}, jst: {}}
  appDir = process.cwd().replace(/\\/g, "\/")
  for key, obj of @originalAssets
    for pkg, patterns of @originalAssets[key]
      matches = []

  expandAssetGlobs()

  # Config defaults
  @appDir = (if options.appDir? then options.appDir else process.cwd())
  @publicDir = path.resolve(@appDir, options.publicDir || 'public')
  @mode = options.mode ? switch process.env.NODE_ENV
    when 'staging' then 'production'
    when 'production' then 'production'
