Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.

Fredde

Member Since 08 Dec 2011
Offline Last Active Dec 19 2015 03:19 PM
-----

Topics I've Started

Will you release any build on NETMF 4.4?

21 April 2015 - 04:12 PM

Is there any plan or schedule for a NETMF 4.4 release?

A faster single stepping and Watch update will make it a million times more fun to work with the Netduino.

"In addition, there are improvements in the debugging and deployment functionality and stability. For example, single stepping and updating the Watch window now takes a fraction of the previous time."

http://blogs.msdn.co...-on-github.aspx


MVC web framework like web server experience on Netduino

23 December 2014 - 02:36 PM

I would like to share a project i have been working with for a long time, it gives you a MVC like developer experience on Netduino.

 

To initialize the server:

public class Program
{
    public static void Main()
    {
        var webServer = new WebServer();
        webServer.Start(80);
    }
}

To create your first controller:

public class MyFirstController : Controller
{
    public void Index()
    {
        SetHtmlResult("<!DOCTYPE html><html><body><h1>My page</h1></html>");        
    }
}

Then run http://192.168.1.100/MyFirst or similar.

 

The main features is:

  • Controller/Action based web request routing with model binding and HTML or JSON response types built in.
  • It support both GET and POST http methods.
  • Exception handling with generic error response that includes exception message and stack trace.
  • It support static files via an optional assembly(to save code space if not needed).
  • Filters on request and response for things like logging, authentication and other things. 

It is built with Dependency injection and has some Unit tests.

 

For source code with running examples and some more decumentation see 

https://github.com/Rinsen/WebServer

 

 

And for long running scenarios i really recommend adding some kind of hardware based watch guard. 

 


home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.