RunicAssetEndpointExtensions class

Namespace Runic.Assets.AspNetCore · Runic.Assets.AspNetCore 0.7.0-preview.5

public static class RunicAssetEndpointExtensions

Maps a Runic Assets source to ASP.NET Core endpoints.

Methods

MapRunicAssetSource

public static IEndpointConventionBuilder MapRunicAssetSource(this IEndpointRouteBuilder endpoints, IAssetSnapshotSource source, string routePrefix = "", AssetRoutingOptions? routing = null)

Maps GET and HEAD below an optional route prefix. Request paths resolve with AssetManifest.TryResolveRequestPath, the same rules and defaults the Desktop adapter uses: the prefix root serves the entry point and missing extensionless paths fall back to it unless routing disables them. The endpoint matches only GET and HEAD requests for paths that resolve. It runs after the application's endpoints and before MapFallback, so other requests reach static files, a fallback or a 404.

WriteAssetAsync

public static Task WriteAssetAsync(HttpContext context, IAssetSnapshotSource source, AssetDescriptor descriptor)

Writes one declared asset with its manifest-owned HTTP metadata.