bryan / wmexamples

Example resources for Webmachine (http://bitbucket.org/justin/webmachine). This project contains several sample webmachine resources that I've posted elsewhere at various times. This is a complete Webmachine app ready to be run and examined.

Clone this repository (size: 42.5 KB): HTTPS / SSH
$ hg clone http://bitbucket.org/bryan/wmexamples/
commit 16: dda57759b0ca
parent 15: b8243f1698ed
branch: default
fix edoc specs so 'make docs' doesn't complain
Bryan Fink
9 months ago

Changed (Δ36 bytes):

raw changeset »

src/dispatch_watcher.erl (4 lines added, 4 lines removed)

src/formjson_resource.erl (2 lines added, 0 lines removed)

Up to file-list src/dispatch_watcher.erl:

31
31
start() ->
32
32
    start([]).
33
33
34
%% @spec start(Options) -> Result
35
%% @type Options = [Option]
36
%% @type Option = {dispatch, Path}|{interval, integer()}
37
%% @type Path = string()
34
%% @spec start(options()) -> Result
35
%% @type options() = [option()]
36
%% @type option() = {dispatch, path()}|{interval, integer()}
37
%% @type path() = string()
38
38
%% @doc Start the watching, monitoring the file given by the
39
39
%%      'dispatch' path option at the interval given by the
40
40
%%      'interval' option, in milliseconds (or the default path

Up to file-list src/formjson_resource.erl:

3
3
%%      re-encodes it as JSON.  The data is expected as query
4
4
%%      parameters for a GET, and request body for a POST.
5
5
%%
6
%%      ```
6
7
%%      In:  one=two&me=pope
7
8
%%      Out: {"one":"two","me":"pope"}
9
%%      '''
8
10
-module(formjson_resource).
9
11
-export([init/1,
10
12
         allowed_methods/2,