Permalink
Browse files

setup initial route & started cowboy

  • Loading branch information...
1 parent d79ca88 commit 7e00d35d823ed99379e4242b4a46534070bc8f94 @brocksamson committed Oct 7, 2012
Showing with 23 additions and 9 deletions.
  1. +2 −0 .gitignore
  2. +3 −0 rebar.config
  3. +18 −9 src/my_game_app.erl
View
@@ -0,0 +1,2 @@
+deps/
+ebin/
View
@@ -0,0 +1,3 @@
+{deps, [{jiffy, ".*", {git, "git://github.com/davisp/jiffy.git", {branch, "master"}}},
+ {cowboy, "0.6.1", {git, "git://github.com/extend/cowboy.git", {tag, "0.6.1"}}}
+ ]}.
View
@@ -1,16 +1,25 @@
-module(my_game_app).
-
-behaviour(application).
-%% Application callbacks
--export([start/2, stop/1]).
+-export([start/0, start/2, stop/1]).
-%% ===================================================================
-%% Application callbacks
-%% ===================================================================
+start() ->
+ reloader:start(), %Makes debugging simple...
+ ok = application:start(cowboy),
+ ok = ssl:start(),
+ ok = inets:start(),
+ ok = application:start(my_game).
start(_StartType, _StartArgs) ->
- my_game_sup:start_link().
+ Dispatch = [
+ {'_', [
+ {[<<"account">>, email], account_handler, []}
+ ]}
+ ],
+ {ok, _} = cowboy:start_listener(http, 100,
+ cowboy_tcp_transport, [{port, 8080}],
+ cowboy_http_protocol, [{dispatch, Dispatch}]
+ ),
+ my_game_sup:start_link().
-stop(_State) ->
- ok.
+stop(_State) -> ok.

0 comments on commit 7e00d35

Please sign in to comment.