- Replace Swashbuckle with NSwag.AspNetCore + NSwag.MSBuild - Configure OpenAPI document in Program.cs via AddOpenApiDocument - Add nswag.json: aspNetCoreToOpenApi → Axios TypeScript client - Post-build target uses NSwagExe_Net80 to run on correct runtime - Client generated to frontend/src/api/apiClient.ts (gitignored) - Add axios to frontend dependencies Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
23 lines
404 B
C#
23 lines
404 B
C#
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
builder.Services.AddControllers();
|
|
builder.Services.AddOpenApiDocument(config =>
|
|
{
|
|
config.Title = "ClaudeTest API";
|
|
config.Version = "v1";
|
|
});
|
|
|
|
var app = builder.Build();
|
|
|
|
if (app.Environment.IsDevelopment())
|
|
{
|
|
app.UseOpenApi();
|
|
app.UseSwaggerUi();
|
|
}
|
|
|
|
app.UseHttpsRedirection();
|
|
app.UseAuthorization();
|
|
app.MapControllers();
|
|
|
|
app.Run();
|