예제 #1
0
        protected void Application_Start(object sender, EventArgs e)
        {
            var vpp    = EmbeddedResourceVirtualPathProviderStart.Start();
            var blazor = new BlazorModuleBuilder();

            var tooling = (typeof(BackendSiteTooling.Class1)).Assembly;

            blazor.HostBlazorModule(tooling);


            var loadingHtml = AssemblyResourceReader.ReadString(tooling, "BackendSiteTooling.Boot.loading.html");

            BootPage.RegisterHtml(loadingHtml);
        }
예제 #2
0
        public WebPipelineAction TryProcessAsBlazorRequest()
        {
            //todo: figure out what the hell to do with this.. can we make this logic dependent on the requesting app?
            //var currentUri = httpRequest.Uri.ToString();//httpRequest.RawUrl;
            //if (currentUri.Contains("/_framework/"))
            if (httpRequest.Uri.AbsolutePath == "/BlazorResource")
            {
                //var indexOf = currentUri.IndexOf("/_framework/");
                //var right = currentUri.Substring(indexOf + 1);
                var appPath = System.Web.HttpUtility.ParseQueryString(httpRequest.Uri.Query)["path"];


                var key   = $"BlazorComponents.Client/dist/_framework/{appPath}";
                var vPath = new BlazorModuleBuilder().GetHostedPath(key);
                //HttpContext.Current.RewritePath(vPath);
                return(new RewriteUrl(vPath));
            }

            return(null);
        }