O'Reilly logo

Getting Started with the Internet of Things by Cuno Pfister

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

HelloWebHtml

Let’s now look at a slightly more interesting version of HelloWeb. HelloWebHtml (Example 10-2) returns an HTML representation. The word Web is printed in bold using HTML’s strong element. In addition, HelloWebHtml adds the time that has passed since the Netduino Plus was last booted, so you can check more easily whether the server is running. If you refresh the web page and the time display changes, the server still runs fine.

Example 10-2. HelloWebHtml

using System;
using Gsiot.Server;

public class HelloWebHtml
{
    public static void Main()
    {
        var webServer = new HttpServer
        {
            RelayDomain = "gsiot-FFMQ-TTD5",
            RelaySecretKey =
                "o5fIIZS5tpD2A4Zp87CoKNUsSpIEJZrV5rNjpg89", RequestRouting = { { "GET /hello.html", HandleGetHelloHtml } } }; webServer.Run(); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required