Permalink
Browse files

Convert to a Sinatra::Base

  • Loading branch information...
loe committed Nov 1, 2010
1 parent 43299f7 commit 10ae6b09f013a84f32cf08c568444bae13ce705c
Showing with 18 additions and 9 deletions.
  1. +9 −9 app.rb
  2. +9 −0 config.ru
  3. 0 views/{index.html.erb → index.erb}
View
18 app.rb
@@ -1,11 +1,11 @@
-require 'rubygems'
-require 'sinatra'
-require 'erb'
+require 'sinatra/base'
-get '/' do
- erb :"index.html"
-end
+class App < Sinatra::Base
+ get '/' do
+ erb :index
+ end
-put '/' do
- puts "uploaded #{env['HTTP_X_FILENAME']} - #{request.body.read.size} bytes"
-end
+ put '/' do
+ puts "uploaded #{env['HTTP_X_FILENAME']} - #{request.body.read.size} bytes"
+ end
+end
View
@@ -0,0 +1,9 @@
+require 'rubygems'
+require 'bundler'
+Bundler.setup
+
+require 'app'
+
+use Rack::Static, :urls => ['/css', '/javascripts'], :root => 'public'
+
+run App
File renamed without changes.

0 comments on commit 10ae6b0

Please sign in to comment.