mirror of
https://github.com/hmaxnl/SharpRSS.git
synced 2024-11-09 23:44:20 +01:00
46 lines
1.2 KiB
C#
46 lines
1.2 KiB
C#
using Microsoft.AspNetCore.Builder;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.Hosting;
|
|
using MudBlazor;
|
|
using MudBlazor.Services;
|
|
using Serilog;
|
|
using SharpRss.Services;
|
|
using ToolQit;
|
|
using WebSharpRSS;
|
|
using WebSharpRSS.Models;
|
|
|
|
Caretaker.Settings.SetAppDefaultSettings();
|
|
Bootstrapper.SetupLogging();
|
|
Log.Information("Starting...");
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
builder.Services.AddRazorPages();
|
|
builder.Services.AddServerSideBlazor();
|
|
builder.Services.AddSingleton<RssService>();
|
|
builder.Services.AddSingleton<FeedStateContainer>();
|
|
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(); |