     return
   
   @usingMiddleware = true
-  
-  if path.extname(req.url) is '.css'
-    res.setHeader?("Content-Type", "text/css")
-    for pkg, filenames of @assets.css
-      for filename in filenames
-        if req.url.replace(/^\/assets\/|.(?!.*\.).*/g, '') is filename.replace(/.(?!.*\.).*/, '')
-          contents = fs.readFileSync(process.cwd() + '/' + filename).toString()
-          contents = preprocess contents, filename
-          res.end contents
-          return
-  
-  if path.extname(req.url) is '.js'
-    res.setHeader?("Content-Type", "application/javascript")
-    
-    if req.url.match /\.jst\.js$/
-      pkg = path.basename req.url, '.jst.js'
-      res.end generateJSTs pkg
-      return
-
-    if req.url.match /nap-templates-prefix\.js$/
-      res.end @_tmplPrefix
-      return
-    
-    for pkg, filenames of @assets.js
-      for filename in filenames
-        if req.url.replace(/^\/assets\/|.(?!.*\.).*/g, '') is filename.replace(/.(?!.*\.).*/, '')
-          contents = fs.readFileSync(process.cwd() + '/' + filename).toString()
-          contents = preprocess contents, filename
-          res.end contents
-          return
+
+  switch path.extname req.url
+  
+    when '.css'
+      res.setHeader?("Content-Type", "text/css")
+      for pkg, filenames of @assets.css
+        for filename in filenames
+          if req.url.replace(/^\/assets\/|.(?!.*\.).*/g, '') is filename.replace(/.(?!.*\.).*/, '')
+            contents = fs.readFileSync(path.resolve process.cwd() + '/' + filename).toString()
+            contents = preprocess contents, filename
+            res.end contents
+            return
+
+    when '.js'
+      res.setHeader?("Content-Type", "application/javascript")
+      
+      if req.url.match /\.jst\.js$/
+        pkg = path.basename req.url, '.jst.js'
+        res.end generateJSTs pkg
+        return
+
+      if req.url.match /nap-templates-prefix\.js$/
+        res.end @_tmplPrefix
+        return
+    
+      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 = preprocess contents, filename
+            res.end contents
+            return
   
   next()
 

    
    if mime?    
      if path.existsSync filename
        base64Str = fs.readFileSync(filename).toString('base64')
      
        newUrl = "data:#{mime};base64,#{base64Str}"
        contents = _.splice(contents, start, end - start, newUrl)

  obj = {}
  
  for filename in @assets[type][pkg]
    contents = fs.readFileSync(path.resolve process.cwd() + '/' + filename).toString()
    contents = preprocess contents, filename
    
    outputFilename = filename.replace /\.[^.]*$/, '' + '.' + type
