chore: adds PostgreSQL

This commit is contained in:
2026-01-27 14:23:58 -05:00
parent 40ea3f45fd
commit 33c6dadb78
6 changed files with 59 additions and 2 deletions

View File

@@ -1,7 +1,13 @@
using Api.Data;
using Microsoft.EntityFrameworkCore;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
// Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi
builder.Services.AddDbContext<AppDbContext>(options =>
options.UseNpgsql(builder.Configuration.GetConnectionString("PostgresConnection")));
builder.Services.AddOpenApi();
var app = builder.Build();
@@ -10,7 +16,7 @@ var app = builder.Build();
if (app.Environment.IsDevelopment())
{
app.MapOpenApi().CacheOutput();
app.UseSwaggerUI(options =>
{
options.SwaggerEndpoint("/openapi/v1.json", "v1");