Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Fix example.
  • Loading branch information
ioquatix committed Aug 30, 2017
1 parent 2981214 commit 4cf8ac4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ server_addresses = [
Async::IO::Endpoint.tcp('127.0.0.1', 9294, reuse_port: true)
]

app = lambda do |env|
[200, {}, ["Hello World"]]
class Server < Async::HTTP::Server
def handle_request(request, peer, address)
[200, {}, ["Hello World"]]
end
end

server = Async::HTTP::Server.new(server_addresses, app)
server = Server.new(server_addresses)
client = Async::HTTP::Client.new(server_addresses)

Async::Reactor.run do |task|
Expand Down

0 comments on commit 4cf8ac4

Please sign in to comment.