38 lines
905 B
C#
38 lines
905 B
C#
using LogViewer.Data;
|
|
using Microsoft.AspNetCore.Components;
|
|
using Microsoft.AspNetCore.Components.Web;
|
|
using Microsoft.Extensions.FileProviders;
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
// Add services to the container.
|
|
builder.Services.AddRazorPages();
|
|
builder.Services.AddServerSideBlazor();
|
|
builder.Services.AddSingleton<WeatherForecastService>();
|
|
builder.Services.AddSingleton<ReportFileService>();
|
|
|
|
var app = builder.Build();
|
|
|
|
// Configure the HTTP request pipeline.
|
|
if (!app.Environment.IsDevelopment())
|
|
{
|
|
app.UseExceptionHandler("/Error");
|
|
}
|
|
|
|
app.UseFileServer(new FileServerOptions
|
|
{
|
|
//FileProvider = new PhysicalFileProvider(@"C:\reports"),
|
|
//RequestPath = new PathString("/reports"),
|
|
//EnableDirectoryBrowsing = true
|
|
//EnableDirectoryBrowsing = false
|
|
});
|
|
|
|
app.UseStaticFiles();
|
|
|
|
app.UseRouting();
|
|
|
|
app.MapBlazorHub();
|
|
app.MapFallbackToPage("/_Host");
|
|
|
|
app.Run();
|