[vz-dev] API

Bart Van Der Meerssche bart.vandermeerssche at flukso.net
Tue Jul 20 10:14:43 CEST 2010


Hello Steffen,

And we have a winner! :-)

Webmachine is an Erlang HTTP framework. It's made for building RESTful 
API's. Take a minute to watch this introductory video: 
http://blog.therestfulway.com/2009/05/video-slideshow-introducing-webmachine.html

And here's the core of our Webmachine API code: 
http://github.com/icarus75/flukso/blob/develop/server/api/flukso/src/flukso_resource.erl

It's 150 lines of code, including validity checking on each query 
parameter. Erlang can do pattern matching on a function's arguments. 
Have a look at the check_time function in the code. check_time is 
mentioned 7 times, but it's a single function. We just check against 7 
different input combinations of the 4 function parameters. The last 
entry check_time(_, _, _, _) is a catchall (The _ and _Name are 
wildcards in Erlang).


Zotonic [http://zotonic.com] is a recent web framework built on top of 
Webmachine. Another one is Nitrogen [http://nitrogenproject.com]. 
Haven't tried them out yet though.


Cheers,
Bart.


On 07/19/2010 11:58 PM, Steffen Vogel wrote:
> Am Montag, den 19.07.2010, 23:38 +0200 schrieb Bart Van Der Meerssche:
>> open:elektro.camp(<<2010>>).
>>
>> Quiz: Guess which language the barcamp title refers to. First one to
>> guess correctly will get ein Helles from me during the camp. Barcamp
>> organizers cannot participate in this contest.
>
> I guess its erlang ;)
>
> Why do you use it for your backend?
> I havn't seen an web framework for this language yet ;)
>
> Regards Steffen
>


More information about the volkszaehler-dev mailing list