How to configure dotnet-webapi-boilerplate to use with a Blazor client #748
Unanswered
MarcoGaribaldi
asked this question in
Q&A
Replies: 1 comment 6 replies
-
Hi @MarcoGaribaldi , did you take a peek at the docs for standing up the Blazor Boilerplate sample app? That documentation can be found here: https://fullstackhero.net/blazor-webassembly-boilerplate/general/getting-started/ |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I am trying to use dotnet-webapi-boilerplate with a Blazor WASM front-end. I am new to Blazor so I need some help in configuring the webapi Program.cs so that it works together with Blazor. According to docs I read and confronting how BlazorHero's Program.cs is, my understanding is that I need to add some configuration lines, as marked in the following code. Can anyone please check this out and let me know if this is correct? Thanks in advance for any suggestions you can share.
`
using System;
using FluentValidation.AspNetCore;
using FSH.WebApi.Application;
using FSH.WebApi.Host.Configurations;
using FSH.WebApi.Host.Controllers;
using FSH.WebApi.Infrastructure;
using FSH.WebApi.Infrastructure.Common;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Serilog;
[assembly: ApiConventionType(typeof(AppApiConventions))]
StaticLogger.EnsureInitialized();
Log.Information("Server Booting Up...");
try
{
var builder = WebApplication.CreateBuilder(args);
}
catch (Exception ex) when (!ex.GetType().Name.Equals("StopTheHostException", StringComparison.Ordinal))
{
StaticLogger.EnsureInitialized();
Log.Fatal(ex, "Unhandled exception");
}
finally
{
StaticLogger.EnsureInitialized();
Log.Information("Server Shutting down...");
Log.CloseAndFlush();
}
`
Beta Was this translation helpful? Give feedback.
All reactions