front y back minimos

This commit is contained in:
2025-08-07 19:19:30 +02:00
parent 11825d7be5
commit b677b5f711
52 changed files with 230 additions and 104 deletions

View File

@@ -9,13 +9,22 @@ public class Program
{
var builder = WebApplication.CreateBuilder(args);
Directory.CreateDirectory(Constants.Data);
// Add services to the container.
builder.Services.AddDbContext<PhotoContext>(options =>options.UseSqlite("Data Source=photos.db"));
builder.Services.AddDbContext<PhotoContext>(options => options.UseSqlite($"Data Source={Constants.Data}/photos.db"));
builder.Services.AddControllers();
// Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi
builder.Services.AddSwaggerGen();
builder.Services.AddCors(options =>
{
options.AddPolicy("AllowAll",
builder => builder.AllowAnyOrigin()
.AllowAnyMethod()
.AllowAnyHeader());
});
var app = builder.Build();
// Configure the HTTP request pipeline.
@@ -29,6 +38,7 @@ public class Program
app.UseAuthorization();
app.UseCors("AllowAll");
app.MapControllers();