public
Description: A very fast & simple Ruby web server
Homepage: http://code.macournoyer.com/thin/
Clone URL: git://github.com/macournoyer/thin.git
macournoyer (author)
Tue Apr 22 05:56:13 -0700 2008
commit  fa4eb39630563d87ea9fc9eee0448e549dfaa840
tree    dfe90b9216cb0e9e038185d9fe18004b339a12da
parent  ae6f5b562bcf86248f28ad1ee6c5599436e5e3b6 parent  863978d258b5890cf4883eed8b1a81d549352276
thin / example / config.ru
100644 26 lines (22 sloc) 0.773 kb
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
# Run with: rackup -s thin
# then browse to http://localhost:9292
# Or with: thin start -r config.ru
# then browse to http://localhost:3000
#
# Check Rack::Builder doc for more details on this file format:
# http://rack.rubyforge.org/doc/classes/Rack/Builder.html
 
require File.dirname(__FILE__) + '/../lib/thin'
 
app = proc do |env|
  # Response body has to respond to each and yield strings
  # See Rack specs for more info: http://rack.rubyforge.org/doc/files/SPEC.html
  body = ['hi!']
  
  [
    200, # Status code
    {
      'Content-Type' => 'text/html', # Reponse headers
      'Content-Length' => body.join.size.to_s
    },
    body # Body of the response
  ]
end
 
run app