summaryrefslogtreecommitdiffstats
path: root/docs/en/cowboy/2.0/guide/getting_started.asciidoc
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2016-09-14 18:52:59 +0200
committerLoïc Hoguin <[email protected]>2016-09-14 18:52:59 +0200
commit348cfe494318d0c12072fd75ff451c3b40168965 (patch)
treedc0186d61b759b248a774cd364d8cb4e073a0c41 /docs/en/cowboy/2.0/guide/getting_started.asciidoc
parenta0db20721bee71e7c0558a83d94ac0c8927b3939 (diff)
downloadninenines.eu-348cfe494318d0c12072fd75ff451c3b40168965.tar.gz
ninenines.eu-348cfe494318d0c12072fd75ff451c3b40168965.tar.bz2
ninenines.eu-348cfe494318d0c12072fd75ff451c3b40168965.zip
Update documentation
Diffstat (limited to 'docs/en/cowboy/2.0/guide/getting_started.asciidoc')
-rw-r--r--docs/en/cowboy/2.0/guide/getting_started.asciidoc26
1 files changed, 13 insertions, 13 deletions
diff --git a/docs/en/cowboy/2.0/guide/getting_started.asciidoc b/docs/en/cowboy/2.0/guide/getting_started.asciidoc
index be11e489..74164be5 100644
--- a/docs/en/cowboy/2.0/guide/getting_started.asciidoc
+++ b/docs/en/cowboy/2.0/guide/getting_started.asciidoc
@@ -91,14 +91,14 @@ code to the `start/2` function to make it look like this:
[source,erlang]
----
start(_Type, _Args) ->
- Dispatch = cowboy_router:compile([
- {'_', [{"/", hello_handler, []}]}
- ]),
- {ok, _} = cowboy:start_clear(my_http_listener, 100,
- [{port, 8080}],
- #{env => #{dispatch => Dispatch}}
- ),
- hello_erlang_sup:start_link().
+ Dispatch = cowboy_router:compile([
+ {'_', [{"/", hello_handler, []}]}
+ ]),
+ {ok, _} = cowboy:start_clear(my_http_listener, 100,
+ [{port, 8080}],
+ #{env => #{dispatch => Dispatch}}
+ ),
+ hello_erlang_sup:start_link().
----
Routes are explained in details in the xref:routing[Routing]
@@ -127,11 +127,11 @@ the `init/2` function like this to send a reply.
[source,erlang]
----
init(Req0, State) ->
- Req = cowboy_req:reply(200,
- #{<<"content-type">> => <<"text/plain">>},
- <<"Hello Erlang!">>,
- Req0),
- {ok, Req, State}.
+ Req = cowboy_req:reply(200,
+ #{<<"content-type">> => <<"text/plain">>},
+ <<"Hello Erlang!">>,
+ Req0),
+ {ok, Req, State}.
----
What the above code does is send a `200 OK` reply, with the