mirror of
https://github.com/XFox111/MuiCharts.git
synced 2026-04-22 06:51:05 +03:00
Added ASP.NET backend with SQLite
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
using System.Reflection;
|
||||
using MuiCharts.Infrastructure;
|
||||
|
||||
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
|
||||
{
|
||||
// Add services to the container.
|
||||
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
||||
builder.Services.AddLogging(options =>
|
||||
{
|
||||
options.AddConfiguration(builder.Configuration.GetSection("Logging"));
|
||||
options.AddConsole();
|
||||
options.AddDebug();
|
||||
options.AddEventSourceLogger();
|
||||
});
|
||||
|
||||
builder.Services.AddControllers(options =>
|
||||
{
|
||||
options.SuppressAsyncSuffixInActionNames = false;
|
||||
});
|
||||
builder.Services.AddInfrastructure();
|
||||
|
||||
builder.Services.AddEndpointsApiExplorer();
|
||||
builder.Services.AddSwaggerGen(options =>
|
||||
{
|
||||
string xmlFileName = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml";
|
||||
string xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFileName);
|
||||
options.IncludeXmlComments(xmlPath);
|
||||
});
|
||||
}
|
||||
|
||||
WebApplication app = builder.Build();
|
||||
{
|
||||
// Configure the HTTP request pipeline.
|
||||
app.UseExceptionHandler("/error");
|
||||
app.UseSwagger();
|
||||
app.UseSwaggerUI();
|
||||
|
||||
// app.UseHttpsRedirection();
|
||||
app.MapControllers();
|
||||
|
||||
app.Run();
|
||||
}
|
||||
Reference in New Issue
Block a user