Static Websites

Static Websites

This handler provides an easy way to serve a static website such as a Hugo application to your clients.

ℹī¸
Static websites can quickly be created by using a project template.

Creating a Static Website

The following example will host the specified application available on http://localhost:8080/.

var tree = ResourceTree.FromDirectory("/var/html/my-website");

var app = StaticWebsite.From(tree);

await Host.Create()
          .Console()
          .Defaults()
          .Handler(app)
          .RunAsync();

Share