Is it possible to embed a Blazor component in a non .NET website?

前端 未结 2 1633
独厮守ぢ
独厮守ぢ 2021-01-05 08:32

We would like to develop a client-side Blazor component for one of our clients to embed on a page in their website. The website is written with Drupal, but really my questi

相关标签:
2条回答
  • 2021-01-05 09:18

    Yes. This is possible. Once you publish client-side Blazor application using dotnet publish resulting files can be served from any static file hosting. For example you could serve the results using http-server . from the folder where results are published.

    To control appearance where Blazor application would be visible in the final HTML application, you can augment index.html as you see fit. <app> tag would be replaced by Blazor application.

    0 讨论(0)
  • 2021-01-05 09:26

    Should be possible. From here: https://docs.microsoft.com/en-us/aspnet/core/blazor/hosting-models?view=aspnetcore-3.0:

    An ASP.NET Core web server isn't required to host the app. Serverless deployment scenarios are possible (for example, serving the app from a CDN).

    If I publish a client-side Blazor project within Visual Studio to the file system then I get the index.html, css folder and a _framework folder containing the js and wasm files.

    I guess it should be possible to serve those from wherever, but not tried it.

    0 讨论(0)
提交回复
热议问题