Hosting Sample

The repo ships samples/HtmlForgeX.Hosting , a minimal ASP.NET Core app that renders HtmlForgeX pages dynamically and demonstrates a transfer workflow similar to a hosted upload product.

What The Sample Covers

  • CSRF wiring with HtmlForgeX defaults
  • Resumable chunked uploads with progress reporting
  • Public download pages plus manage links
  • Optional cookie authentication and admin/user roles
  • SQLite-backed metadata so the sample survives restarts

Run The Sample

dotnet run --project samples/HtmlForgeX.Hosting

Then open routes such as:

  • http://localhost:5000/home
  • http://localhost:5000/transfers/new
  • http://localhost:5000/transfers
  • http://localhost:5000/admin/users

Why It Matters

This sample is the clearest end-to-end example of how the optional HtmlForgeX.AspNetCore package fits into a real application:

  • assets are served from /hfx/*
  • HTML output uses linked assets instead of giant inline blobs
  • uploads report progress without bespoke front-end code
  • metadata is stored outside the generated document so workflows remain stateful

Storage And Configuration

  • SQLite metadata defaults to App_Data/tierbridge.sqlite
  • transfer files are stored under App_Data/transfers/<transferId>/...
  • upload parts are staged under App_Data/uploads/<transferId>/<uploadId>.part

The sample also supports optional API-key authorization for manage actions plus seeded cookie-auth admin accounts.