Add DELETE /api/exports/{id} endpoint with cascade delete, trash icon
buttons on both the exports list and export detail pages, and disable
browser caching for static files to prevent stale JS issues.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
27 lines
847 B
C#
27 lines
847 B
C#
using FabWorks.Api.Configuration;
|
|
using FabWorks.Api.Services;
|
|
using FabWorks.Core.Data;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
builder.Services.AddControllers();
|
|
builder.Services.AddDbContext<FabWorksDbContext>(options =>
|
|
options.UseSqlServer(builder.Configuration.GetConnectionString("FabWorksDb")));
|
|
builder.Services.AddSingleton<FormProgramService>();
|
|
|
|
builder.Services.Configure<FileStorageOptions>(
|
|
builder.Configuration.GetSection(FileStorageOptions.SectionName));
|
|
builder.Services.AddScoped<IFileStorageService, FileStorageService>();
|
|
|
|
var app = builder.Build();
|
|
|
|
app.UseDefaultFiles();
|
|
app.UseStaticFiles(new StaticFileOptions
|
|
{
|
|
OnPrepareResponse = ctx =>
|
|
ctx.Context.Response.Headers.Append("Cache-Control", "no-cache, no-store")
|
|
});
|
|
app.MapControllers();
|
|
app.Run();
|