Skip to content

Host To Folder Mapping

mattkol edited this page Jul 14, 2021 · 2 revisions

Host-To-Folder mapping is the primary way to load resource files for EdgeSharp as it requires no custom resource handler. All is required is to add/register it in the Schemes.

To register Host-To-Folder Scheme, it requires

  • Scheme - e.g http, https
  • Host - e.g edgesharp.com, myhost.com
  • Folder - The folder name - usually relative to the application folder (where the exe is).
  • Scheme type - HostToFolder. Other scheme types can be found at: UrlSchemeType.

Following will use:

Scheme Host Folder Scheme Type Index or Default File
http app app HostToFolder index.html
var config = new Configuration();
var hostToFolderscheme = new UrlScheme("http", "app", "app", UrlSchemeType.HostToFolder);
config.UrlSchemes.Add(hostToFolderscheme);
config.StartUrl = "http://app/index.html";