1
2
3
4
5
6
7
8
9
10
11
12
13
14
-module(test).

-compile([debug_info]).
-export([start/0, loopy/1]).

start() -> start(9998).

start(Port) ->
    mochiweb_http:start([{port, Port}, {loop, fun loopy/1}]).
        
loopy(x) ->
    receive
        _ -> loopy(x)
    end.