Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
1 parent
7b64345
commit 7be70b2
Showing
3 changed files
with
22 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |