O'Reilly logo

Mastering Internet of Things by Peter Waher

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

Adding default redirections

Users normally don't remember syntax, so we can't assume they will remember the URL for the device. The IP address should be sufficient. To solve this, we want to create a default resource that redirects to our default page if only the IP address is provided. This is easily done as follows:

this.httpServer.Register("/", (req, resp) => 
{ 
   throw new TemporaryRedirectException("/Index.md"); 
}); 

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