Skip to content

StaticFiles route handler

Tom Kuijsten edited this page Sep 30, 2016 · 3 revisions

Setup

Follow the steps described in the one pager

Add files

Create a "Web" folder in your project and add a file named "index.html". Put some basic html to test your page, something like:

<!DOCTYPE html>
<html>
  <body>
    <h1>Running on a Windows Universal device</h1>
  </body>
</html>

Make sure your "index.html" is set to "Content" as build action.

Register static file handler

var configuration = new HttpServerConfiguration()
  .RegisterRoute(new StaticFileRouteHandler(@"Web"));

That's it. You can test this by opening a browser and go to http://yourserver/ and your index.html should be displayed.

Clone this wiki locally