aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2011-05-07 16:19:01 +0200
committerLoïc Hoguin <[email protected]>2011-05-07 16:22:19 +0200
commit39513deacaf69854ed0ec13433a77dfa2f720d8c (patch)
tree9d331aac02174a1052daf06aeb6cddb9aee6d611
parent078ab340e968a26cee98e213d8ecb70ea19ca1ab (diff)
downloadcowboy-39513deacaf69854ed0ec13433a77dfa2f720d8c.tar.gz
cowboy-39513deacaf69854ed0ec13433a77dfa2f720d8c.tar.bz2
cowboy-39513deacaf69854ed0ec13433a77dfa2f720d8c.zip
Removed a few lines from the README for pedantic correctness.
-rw-r--r--README.md33
1 files changed, 13 insertions, 20 deletions
diff --git a/README.md b/README.md
index 439474c..5c7df2d 100644
--- a/README.md
+++ b/README.md
@@ -64,28 +64,21 @@ Don't worry about it right now though and continue reading, it'll all
be explained.
You can start and stop listeners by calling `cowboy:start_listener/6` and
-`cowboy:stop_listener/1` respectively, as demonstrated in the following
-example.
+`cowboy:stop_listener/1` respectively.
+
+The following example demonstrates the startup of a very simple listener.
``` erlang
--module(my_app).
--behaviour(application).
--export([start/2, stop/1]).
-
-start(_Type, _Args) ->
- application:start(cowboy),
- Dispatch = [
- %% {Host, list({Path, Handler, Opts})}
- {'_', [{'_', my_handler, []}]}
- ],
- %% Name, NbAcceptors, Transport, TransOpts, Protocol, ProtoOpts
- cowboy:start_listener(http, 100,
- cowboy_tcp_transport, [{port, 8080}],
- cowboy_http_protocol, [{dispatch, Dispatch}]
- ).
-
-stop(_State) ->
- ok.
+application:start(cowboy),
+Dispatch = [
+ %% {Host, list({Path, Handler, Opts})}
+ {'_', [{'_', my_handler, []}]}
+],
+%% Name, NbAcceptors, Transport, TransOpts, Protocol, ProtoOpts
+cowboy:start_listener(http, 100,
+ cowboy_tcp_transport, [{port, 8080}],
+ cowboy_http_protocol, [{dispatch, Dispatch}]
+).
```
This is not enough though, you must also write the my_handler module