Class: Bones::Server

Inherits:
Object show all
Defined in:
lib/bones/server.rb

Class Method Summary collapse

Class Method Details

.runObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/bones/server.rb', line 3

def self.run
  statics = Bones.public_directories
  app = Rack::Builder.new do
    use Rack::CommonLogger
    use Rack::ShowExceptions
    use Rack::Reloader
    use Bones::Static
    run Bones::Proxy.new
  end

  port = ARGV.shift || 3000
  puts "** Starting bones server on http://0.0.0.0:#{port}"
  puts "** Public directories: #{statics.to_sentence}"

  Rack::Handler::Mongrel.run app, :Port => port do |server|
    puts "** Use CTRL-C to stop."
  end
end