My webserver has some history. At first it started as WSGI module for lighttpd and ended up as standalone tornado based web server. Request handler was located in wsgi specific functions and after moving to tornado it was easier to make sort of adapter to comply it. Simple code looks cumbersome and awkward. To add new url handler I have to add additional clause in hufe if-elsei-f tree.
In this issue I want create class that able to register url callback so adding new handler should be as easy as:
urlHandler.register("/srv/new/url/", handler) where handler is lanbda or named function or functional object that takes two input parameter: url value and dictionary of request headers.
My webserver has some history. At first it started as WSGI module for lighttpd and ended up as standalone tornado based web server. Request handler was located in wsgi specific functions and after moving to tornado it was easier to make sort of adapter to comply it. Simple code looks cumbersome and awkward. To add new url handler I have to add additional clause in hufe if-elsei-f tree. In this issue I want create class that able to register url callback so adding new handler should be as easy as: urlHandler.register("/srv/new/url/", handler) where handler is lanbda or named function or functional object that takes two input parameter: url value and dictionary of request headers.