Utility Blazor

Published on Monday, 28 September 2020

To add to my increasing collection of Utility apps I've decided to produce a Blazor version.

I love the idea of writing the web app in C#, with minimal js, and being able to host it anywhere.

Azure Static Web Apps look like a nice option too.

The initial site has been configured and is deploying:

I'm looking forward to trying out bUnit for Unit Testing.

I found a GitHub Action to deploy it to GitHub Pages, just a couple of tasks to modify the ouptut so it runs correctly.

Much like an AngularJS app you need to set the base href so the app loads properly.

- name: Change base-tag in index.html from / to blazor-test
  run: sed -i 's/<base href="\/" \/>/<base href="\/blazor-test\/" \/>/g' release/wwwroot/index.html

To help with routing make the 404 the same as the index.

- name: copy index.html to 404.html
  run: cp release/wwwroot/index.html release/wwwroot/404.html

As GHP uses jekyll add the following file so it doesnt use those settings.

- name: Add .nojekyll file
  run: touch release/wwwroot/.nojekyll

Next I just need to port the original feature set to this application.

References

Thanks to @Swimburger for the GitHub Action for deploying the app to GitHub Pages

How to deploy ASP.NET Blazor WebAssembly to GitHub Pages