1
0
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:
2024-02-22 11:06:44 +00:00
parent d96b683a90
commit be8cc7ded4
39 changed files with 2109 additions and 0 deletions
+42
View File
@@ -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();
}