Single Page Application

In this example we host a SPA (embedded resources) placed inside the Docs folder.

Adapt your Location object to configure the resource origin.

using System.Reflection;
using Wired.IO.App;
using Wired.IO.Http11Express.StaticHandlers;

await WiredApp
    .CreateExpressBuilder()
    .Port(8080)
    .AddSpaProvider("/*",
        new Location
        {
            Assembly = Assembly.GetExecutingAssembly(),
            LocationType = LocationType.EmbeddedResource,
            Path = "Docs"
        }, []) // Pass middleware collection here
    .Build()
    .RunAsync();