Add behavior which simply defines a handle(Req, Resp) function
jetztgradnet opened this issue · comments
The examples always contain the start/stop code for a single web server, so I still need to decide in my code, which webserver to use. What I would like to see is my code consisting of a handle(Req, Resp)
function, which is called by some other module, ideally the request bridge. handle(Req, Resp)
would then be the sole and web server independent entry point to my HTTP code.
A module similar to https://github.com/etnt/rebar_templates/blob/master/nitro_inets.erl could be part of simple_bridge, which adds the loop
function for several web servers
This article explains the idea very nicely: http://www.redhoterlang.com/entry/b4e6c0afca712a3b4f15869018000b2e
simple bridge 2.0 will be doing this. https://github.com/nitrogen/simple_bridge/tree/ws