2023-04-27 17:23:01 +02:00
|
|
|
using Microsoft.AspNetCore.Builder;
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
using Microsoft.Extensions.Hosting;
|
|
|
|
using MudBlazor;
|
|
|
|
using MudBlazor.Services;
|
2023-05-18 01:27:11 +02:00
|
|
|
using SharpRss.Services;
|
2023-05-07 18:37:25 +02:00
|
|
|
using WebSharpRSS;
|
2023-05-15 15:53:08 +02:00
|
|
|
using WebSharpRSS.Models;
|
2023-05-07 18:37:25 +02:00
|
|
|
|
2023-06-04 02:16:47 +02:00
|
|
|
Bootstrapper.Bootstrap();
|
2023-04-27 17:23:01 +02:00
|
|
|
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
builder.Services.AddRazorPages();
|
|
|
|
builder.Services.AddServerSideBlazor();
|
2023-05-18 20:15:31 +02:00
|
|
|
builder.Services.AddSingleton<RssService>();
|
2023-05-17 16:03:04 +02:00
|
|
|
builder.Services.AddSingleton<FeedStateContainer>();
|
2023-04-27 17:23:01 +02:00
|
|
|
builder.Services.AddMudServices(config =>
|
|
|
|
{
|
|
|
|
config.SnackbarConfiguration.PositionClass = Defaults.Classes.Position.BottomRight;
|
|
|
|
config.SnackbarConfiguration.PreventDuplicates = true;
|
|
|
|
config.SnackbarConfiguration.ShowCloseIcon = true;
|
|
|
|
config.SnackbarConfiguration.SnackbarVariant = Variant.Filled;
|
|
|
|
});
|
|
|
|
|
|
|
|
var app = builder.Build();
|
|
|
|
|
|
|
|
if (!app.Environment.IsDevelopment())
|
|
|
|
{
|
|
|
|
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
|
|
|
app.UseHsts();
|
|
|
|
}
|
|
|
|
|
|
|
|
app.UseHttpsRedirection();
|
|
|
|
|
|
|
|
app.UseStaticFiles();
|
|
|
|
|
|
|
|
app.UseRouting();
|
|
|
|
|
|
|
|
app.MapBlazorHub();
|
|
|
|
app.MapFallbackToPage("/_Host");
|
|
|
|
|
|
|
|
app.Run();
|