-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.ru
More file actions
45 lines (33 loc) · 849 Bytes
/
config.ru
File metadata and controls
45 lines (33 loc) · 849 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
require 'rubygems'
require 'sinatra/base'
require 'data_mapper'
require 'dm-types'
require 'dm-constraints'
require 'dm-serializer'
require 'json'
require './app'
require './app/models/models'
#################################################
#
# Setup DataMapper, and initialize the database
#
DataMapper::Logger.new $stdout, :debug
DataMapper.setup :default, ENV['DATABASE_URL'] || 'sqlite::memory:'
DataMapper.finalize
load 'irb/init_db.rb'
#################################################
#
# If we're in our development environment
# startup WEBrick
#
if ENV['RACK_ENV'] == 'development'
require 'webrick'
options = {
:Port => 3000,
:Logger => WEBrick::Log::new($stderr, WEBrick::Log::DEBUG),
:DocumentRoot => "public"
}
Rack::Handler::WEBrick.run ProtoDemo::App, options
else
run ProtoDemo::App
end