private static IApplicationBuilder UseVoyagerSettingsMiddleware( this IApplicationBuilder applicationBuilder, VoyagerOptions options) { return(applicationBuilder.Map( options.Path.Add(new PathString("/settings.js")), app => app.UseMiddleware <SettingsMiddleware>(options))); }
public SettingsMiddleware( RequestDelegate next, VoyagerOptions options) { Next = next; _options = options ?? throw new ArgumentNullException(nameof(options)); Uri uiPath = UriFromPath(options.Path); Uri queryPath = UriFromPath(options.QueryPath); _queryPath = uiPath.MakeRelativeUri(queryPath).ToString(); }
public static IApplicationBuilder UseVoyager( this IApplicationBuilder applicationBuilder, VoyagerOptions options) { if (options == null) { throw new ArgumentNullException(nameof(options)); } return(applicationBuilder .UseVoyagerSettingsMiddleware(options) .UseVoyagerFileServer(options.Path)); }