29 lines
561 B
C#
29 lines
561 B
C#
using Microsoft.EntityFrameworkCore;
|
|
using PaperlessAI.Context;
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
// Add services to the container.
|
|
|
|
builder.Services.AddControllers();
|
|
|
|
builder.Services.AddDbContextPool<MyDbContext>(options =>
|
|
{
|
|
options.UseMySql(
|
|
builder.Configuration.GetConnectionString("MariaDbConnectionString"),
|
|
ServerVersion.Parse("12.0.2-mariadb")
|
|
);
|
|
});
|
|
|
|
var app = builder.Build();
|
|
|
|
// Configure the HTTP request pipeline.
|
|
|
|
app.UseHttpsRedirection();
|
|
|
|
app.UseAuthorization();
|
|
|
|
app.MapControllers();
|
|
|
|
app.Run();
|