Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Tweaked stuff to work better, yay
  • Loading branch information
robertmeta committed Feb 26, 2012
1 parent 1366993 commit 23f0218
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
5 changes: 3 additions & 2 deletions README.md
@@ -1,7 +1,8 @@
Quickstart
===============================================================================
* Go into the cowboy directory and run "make" to build Cowboy. This is
dependent on three things: *make*, *rebar* and *git*
* If you already have *make*, *rebar* and *git* in your path
* make && ./startit.sh
* run whatever server you want by starting it example -> helloworld:start()

Notes
===============================================================================
Expand Down
7 changes: 5 additions & 2 deletions apps/hello_world/src/hello_world.erl
@@ -1,12 +1,15 @@
-module(hello_world).
-export([start/0]).
-export([start/0, stop/0]).

start() ->
application:start(cowboy),
Dispatch = [
{'_', [{'_', hello_world_handler, []}]}
],
cowboy:start_listener(my_http_listener, 100,
cowboy:start_listener(my_http_listener, 3,
cowboy_tcp_transport, [{port, 8080}],
cowboy_http_protocol, [{dispatch, Dispatch}]
).

stop() ->
application:stop(cowboy).
2 changes: 2 additions & 0 deletions startit.sh → startit
@@ -1,3 +1,5 @@
#!/bin/sh

erl \
-pa deps/cowboy/ebin \
-pa apps/hello_world/ebin \
Expand Down

0 comments on commit 23f0218

Please sign in to comment.