This callback allows you to quickly switch the "handling" of any http request.
/// <summary> /// Handles the CommandReceived event. /// </summary> private static string server_CommandReceived(Request request) { //"hello world" implementation. //return (new HelloAction()).Action(request); //led control implementation return (new LedAction(Hardware.Led)).Action(request); }
Right now the only ones that work are HelloAction and LedAction, but others could easily be written in the same manner. I plan to write one which will return an html file from the sd card - like IIS or Apache.
I simplified the interpretation structure, because I don't really want to use the web server to light LED's - truthfully I'm not sure exactly WHAT I want to use it for yet. But this allows me to use it for just about anything, without rewriting the whole thing or copying code.