This template can be used as a base to create a Bolero application.
To learn more, you can check the documentation.
To get started, you need the following installed:
- .NET SDK 5.0. Download it here.
To create a project based on this template, first install the template to your local dotnet:
dotnet new -i Bolero.Templates
Then, you can create a project like so:
dotnet new bolero-app -o YourAppName
This will create a project in a new folder named YourAppName
.
You can use the following options to customize the project being created:
-
Project content options:
-
--minimal
,-m
:If
true
, the created project is a minimal application skeleton with empty content.If
false
(the default), the created project includes Bolero features such as routed pages, HTML templates and remoting. -
--server
,-s
:If
true
(the default), the solution includes aServer
project, which is an ASP.NET Core server that hosts the application.If
false
, the solution only contains theClient
project that is compiled to WebAssembly. -
--hostpage
,-hp
:Determines how the server-side HTML page content is written. Can be one of:
-
bolero
: using Bolero.Html functions. -
razor
: using a dynamically-compiled Razor page. -
html
: using a plain .html file.
This is ignored if
server=false
. -
-
--html
,-ht
:If
true
(the default), use HTML templates.If
false
, use F# functions for HTML content.This is ignored if
minimal=true
, because the minimal project doesn't contain any HTML content. -
--hotreload
,-hr
:Enable hot reloading for HTML templates.
The default is
true
.This is ignored if
server=false
, because hot reloading requires a server side. -
--pwa
,-pwa
:Create the client side as a progressive web app.
-
-
Package management options:
-
--nightly
,-ni
:Reference the nightly release of Bolero.
-
--paket
,-p
:Use Paket for package management.
-
Visual Studio Code or Visual Studio is recommended to edit this project.
To compile the project, you can run:
dotnet build
To run it:
dotnet run -p src/YourAppName.Server
# Or if you created the project with --minimal=true --server=false:
dotnet run -p src/YourAppName.Client
-
src/YourAppName.Client
is the project that gets compiled to WebAssembly, and contains your client-side code.-
Startup.fs
sets up Blazor to get the application started. -
Main.fs
contains the main body of the page.
-
-
src/YourAppName.Server
is the host ASP.NET Core application, and contains your server-side code.
To learn more about Bolero, you can check the documentation.