aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/basic_auth/README.md5
-rw-r--r--examples/basic_auth/src/basic_auth_app.erl6
2 files changed, 5 insertions, 6 deletions
diff --git a/examples/basic_auth/README.md b/examples/basic_auth/README.md
index 74662cd..38ae9a2 100644
--- a/examples/basic_auth/README.md
+++ b/examples/basic_auth/README.md
@@ -1,5 +1,5 @@
-Cowboy Basic Authorization Rest Hello World.
-============================================
+Cowboy Basic Authorization Rest Hello World
+===========================================
To compile this example you need rebar in your PATH.
@@ -41,4 +41,3 @@ content-type: text/plain
Hello, Alladin!
```
-
diff --git a/examples/basic_auth/src/basic_auth_app.erl b/examples/basic_auth/src/basic_auth_app.erl
index c60a574..24c766e 100644
--- a/examples/basic_auth/src/basic_auth_app.erl
+++ b/examples/basic_auth/src/basic_auth_app.erl
@@ -11,11 +11,11 @@
%% API.
start(_Type, _Args) ->
- Dispatch = [
+ Dispatch = cowboy_router:compile([
{'_', [
- {[], toppage_handler, []}
+ {"/", toppage_handler, []}
]}
- ],
+ ]),
{ok, _} = cowboy:start_http(http, 100, [{port, 8080}], [
{env, [{dispatch, Dispatch}]}
]),