From 006e05a375e4729abeebfcaf134811d27d0e8edb Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Tue, 7 Jul 2026 21:48:02 +0100 Subject: [PATCH] fix(blogs): register controller endpoints via MapControllers All [ApiController] classes (BlogApi, BlogTags, PostTags, FileSystem, FileSystemStream, Comments, TagsApi) returned 404 on every route, even though Kestrel was up. The pipeline in Program.cs was missing MapControllers(), so the controllers were never attached to the endpoint data source. MapIdentityApi and MapGet("/identity") worked because they're explicit minimal-API routes; the attribute- routed controllers didn't. Confirmed end-to-end: GET /api/v1/blog now returns 401 (auth required by [Authorize("BlogScope")]) instead of 404. --- src/Yavsc.Blogs/Program.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Yavsc.Blogs/Program.cs b/src/Yavsc.Blogs/Program.cs index 47cd3f38..b338e1cb 100644 --- a/src/Yavsc.Blogs/Program.cs +++ b/src/Yavsc.Blogs/Program.cs @@ -88,6 +88,7 @@ internal class Program .UseAuthorization() .UseCors("default") ; + app.MapControllers(); app.MapIdentityApi().RequireAuthorization("BlogScope"); app.MapGet("/identity", (HttpContext context) =>