Blazor without a server (not serverless)

Viewed 1969

I've been reading about Blazor and even played with some sample code. However, I'm not finding the answer to my question. I'm looking to run Blazor as a front end for an app that I'm re-writing and I'd like to do this without installing IIS if possible. When I search for "Blazor serverless" I get azure functions. Is it possible to to utilize Blazor clientside without IIS and if so what is this programming process called?

3 Answers

I guess that you are talking about Blazor wasm.

You can deploy Blazor WasAssembly as a static files to several a static file server such Nginx, Apache or even IIS. Link below provides more information.

host and deploy

You can deploy a Blazor WebAssembly app to any static file storage that will allow web access for file delivery. No server needs to be involved, so this could be in Azure Blob Storage, AWS S3 buckets, static file server for hire of your choice, etc. Once the client browser gets the static files it can fire up, and begin interacting with API endpoints set up on a backend server somewhere. (Yours or other public API's). You will need to make sure all authentication and authorization is happening server side, but this will allow you to use Blazor with existing API endpoints.

If you need to persist data or do anything with personal information and you don't have an existing server in place, you will need something like that, but the good news is that you can use anything you want for the back end API as long as your Blazor app and the API agree on how to communicate.

You can simply right-click the Blazor project in the Visual studio solution explorer, then select publish and select a method. I’d suggest starting with publish to file, then you can modify after testing. Grab all the files in the publish folder and copy them to the root of your website.

Just remember that serverside cannot function this way, only clientside wasm Blazor.

Related