nitrogen / simple_bridge

A simple, standardized interface library to Erlang HTTP Servers.
MIT License
112 stars 76 forks source link

Add behavior which simply defines a handle(Req, Resp) function #7

Closed jetztgradnet closed 10 years ago

jetztgradnet commented 13 years ago

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 loopfunction for several web servers

jetztgradnet commented 13 years ago

This article explains the idea very nicely: http://www.redhoterlang.com/entry/b4e6c0afca712a3b4f15869018000b2e

choptastic commented 10 years ago

simple bridge 2.0 will be doing this. https://github.com/nitrogen/simple_bridge/tree/ws