Permalink
Browse files

Fix rendering of non-html files.

  • Loading branch information...
1 parent 7b6044c commit 222788bf177e2a0d6c1536463089eb9f344454cc @benbjohnson committed Mar 15, 2012
Showing with 12 additions and 0 deletions.
  1. +4 −0 examples/index.html
  2. +3 −0 examples/main.css
  3. +5 −0 lib/httpng/app.rb
View
@@ -1,5 +1,9 @@
<html>
+<head>
+ <link href="main.css" rel="stylesheet">
+</head>
+
<body>
<div data-export="my_img" style="border:1px solid black; background:#fff;">
<span>This is some text.</span>
View
@@ -0,0 +1,3 @@
+.test {
+ background:#333;
+}
View
@@ -49,6 +49,11 @@ class App < Sinatra::Base
halt 200
end
+ get '/*' do
+ file = File.join(settings.public_dir, "#{request.path_info}")
+ send_file(file, :disposition => 'inline', :filename => File.basename(file))
+ end
+
##############################################################################
#

0 comments on commit 222788b

Please sign in to comment.