Is it possible to contribute in the Gadgeteer source code?
Should be very nice to add such code in the WebServer class
/// Gets the WebServerManager instance, which is handled as a singleton.
/// <returns>The <see cref="T:GTM.NetworkModule.WebServerManager"/> instance</returns>
public static WebServerManager GetInstance()
if (serverManager == null)
serverManager = new WebServerManager();
serverManager.DefaultEvent = new WebEvent("index.html");
serverManager.DefaultEvent.ResponseData = Encoding.UTF8.GetBytes("<html><head></head><body><h1>Hey, it works:-)</h1><p>Your own .NET Gadgeteer Web Server is up and running!</p></body></html>");
serverManager.DefaultEvent.ContentType = "text/html";
And this code in the WebServerManager class:
/// Update the Default Web Event for the server so that an http GET request can be processed.
/// <returns>A <see cref="T:GTM.NetworkModule.WebEvent"/> object that is used to update data and respond to incoming requests.
public static WebEvent GetDefaultWebEvent()
In this way it would be possible to access the Default WebEvent!!!
Your own .NET Gadgeteer Web Server is up and running! is not an option for a professional purpose!!!
But I think there’s something you’re not doing or understanding. I can’t quite pinpoint it though. To me you only see the “hey it’s running” text if you don’t provide your own handler for a site. (although I agree, it would be better to have some more generic text there that says something like “You’ve reached the default website for <device/URI>.” rather than the text you see today)
404 is the standard pattern for a full web server. but doen’t matyer… re ad again my sue case. that si what i would like to do… and configuring even a full web server si possibile using some configuration.
anyway look better at the code… getwebeventbyid.
if no web event found for the path specified it will sue the default handler. and… i would like just to change that default… i think it s easy and general purpose!