Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/albx/BlazorSwa.Template
Template for the .NET CLI to create a Blazor project for Azure Static Web Apps
https://github.com/albx/BlazorSwa.Template
Last synced: about 2 months ago
JSON representation
Template for the .NET CLI to create a Blazor project for Azure Static Web Apps
- Host: GitHub
- URL: https://github.com/albx/BlazorSwa.Template
- Owner: albx
- License: mit
- Created: 2022-04-04T09:43:44.000Z (almost 3 years ago)
- Default Branch: dev
- Last Pushed: 2024-05-20T04:43:33.000Z (8 months ago)
- Last Synced: 2024-05-20T05:37:25.244Z (8 months ago)
- Language: HTML
- Size: 208 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-blazor - BlazorSwa Template - This is a simple template for the .NET CLI which allows to create a Blazor project ready to be deployed in an Azure Static Web Apps. It allows to create an Azure Function project as backend. (Templates / Get started)
README
# BlazorSwa.Template
A project template for creating a Blazor WebAssembly app and, optionally, an Azure Function api which will be hosted on Azure Static Web Apps.## Requirements
.NET 8 SDK with Azure workload and Azure Functions v4 runtime must be installed.In order to run locally your project, you can install the **Azure Static Web Apps CLI** following the instructions in the [official documentation](https://azure.github.io/static-web-apps-cli/docs/use/install).
## Installation
You can install the package from [NuGet](https://www.nuget.org/packages/BlazorSwa.Template/) using this command from the .NET CLI:
```
dotnet new --install BlazorSwa.Template
```## Usage
Execute the following command from the .NET CLI:
```
dotnet new blazorswa -n
```
to create a project containing a Blazor WebAssembly client and a simple Azure Function project with isolated runtime.If you prefer Visual Studio to create the project, search *Blazor static web app* in the *Search for templates* bar and follow the wizard.
### Options
The following option is available:
- **--include-api**: *(bool)* specifies whether add the azure function project (isolated runtime). The default value is **false**.### Examples
To create a Blazor WebAssembly project with an Azure Function project with isolated runtime, execute the following command from the .NET CLI:
```
dotnet new blazorswa --include-api -n
```### Some tips
To create a Static Web App resource on Azure, please follow the Microsoft documentation at this link: [https://docs.microsoft.com/en-us/azure/static-web-apps/get-started-portal?tabs=blazor&pivots=github#create-a-static-web-app](https://docs.microsoft.com/en-us/azure/static-web-apps/get-started-portal?tabs=blazor&pivots=github#create-a-static-web-app).
## Contributing
Contributions are always welcome!
If you want to submit any issues or new features, please [follow these few and simple guidelines](CONTRIBUTING.md).