You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21-13Lines changed: 21 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,21 +20,23 @@ Each HTTP request within Goliath is executed in its own Ruby fiber and all async
20
20
21
21
## Getting Started: Hello World
22
22
23
-
require 'goliath'
23
+
```ruby
24
+
require'goliath'
24
25
25
-
class Hello < Goliath::API
26
-
# reload code on every request in dev environment
27
-
use ::Rack::Reloader, 0 if Goliath.dev?
26
+
classHello < Goliath::API
27
+
defresponse(env)
28
+
[200,{}, "Hello World"]
29
+
end
30
+
end
28
31
29
-
def response(env)
30
-
[200,{}, "Hello World"]
31
-
end
32
-
end
32
+
> ruby hello.rb -sv
33
+
> [97570:INFO] 2011-02-1500:33:51 :: Starting server on 0.0.0.0:9000in development mode. Watch out for stones.
34
+
```
33
35
34
-
> ruby hello.rb -sv
35
-
> [97570:INFO] 2011-02-15 00:33:51 :: Starting server on 0.0.0.0:9000 in development mode. Watch out for stones.
36
+
See examples directory for more, hands-on examples of building Goliath powered web-services. Are you new to EventMachine, or want a detailed walk-through of building a Goliath powered API? You're in luck, we have two super-awesome peepcode screencasts which will teach you all you need to know:
36
37
37
-
See examples directory for more, hands-on examples of building Goliath powered web-services.
38
+
*[Meet EventMachine: Part 1](http://peepcode.com/products/eventmachine) - introduction to EM, Fibers, etc.
39
+
*[Meet EventMachine: Part 2](http://peepcode.com/products/eventmachine-ii) - building an API with Goliath
38
40
39
41
## Performance: MRI, JRuby, Rubinius
40
42
@@ -55,7 +57,7 @@ Goliath has been in production at PostRank for over a year, serving a sustained
55
57
* Mongrel is a threaded web-server, and both Passenger and Unicorn fork an entire VM to isolate each request from each other. By contrast, Goliath builds a single instance of the Rack app and runs all requests in parallel through a single VM, which leads to a much smaller memory footprint and less overhead.
56
58
57
59
* How do I deploy Goliath in production?
58
-
* We recommend deploying Goliath behind a reverse proxy such as HAProxy, Nginx or equivalent. Using one of the above, you can easily run multiple instances of the same application and load balance between them within the reverse proxy.
60
+
* We recommend deploying Goliath behind a reverse proxy such as HAProxy ([sample config](https://github.com/postrank-labs/goliath/wiki/HAProxy)), Nginx or equivalent. Using one of the above, you can easily run multiple instances of the same application and load balance between them within the reverse proxy.
59
61
60
62
## Guides
61
63
@@ -66,6 +68,7 @@ Goliath has been in production at PostRank for over a year, serving a sustained
0 commit comments