Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* revamped where the config is set
 * added rake file so we can run this app from the cmdline with rake run
  • Loading branch information
bunnymatic committed Jun 27, 2011
1 parent 7b64345 commit 7be70b2
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
11 changes: 11 additions & 0 deletions Rakefile
@@ -0,0 +1,11 @@
require 'rake'
require 'sinatra'
require './the_app.rb'

desc 'run the server'
# so we don't have to run thin if we don't want to
task :run do |t|
require './the_app.rb'
TheApp.run!
end

5 changes: 1 addition & 4 deletions config.ru
@@ -1,12 +1,9 @@
require 'rubygems'
require 'sinatra'
require 'datamapper'

set :environment, :production
set :port, 5000
disable :run, :reload

require './the_app.rb'

DataMapper::setup(:default, "sqlite3://#{Dir.pwd}/the_app.db")

run TheApp.new
10 changes: 10 additions & 0 deletions the_app.rb
@@ -1,7 +1,17 @@
require 'sinatra'
require 'datamapper'

class TheApp < Sinatra::Base
set :environment, :production
set :logging, true
set :root, Dir.pwd
set :port, 5678
APP_ROOT = root

DataMapper::setup(:default, "sqlite3://#{root}/the_app.db")

get '/' do
'yo'
end
run! if app_file == $0
end

0 comments on commit 7be70b2

Please sign in to comment.