수정: 블로그 상세 라우트 충돌 제거
TaxBaik CI/CD / build-and-deploy (push) Successful in 1m8s
TaxBaik Browser E2E / browser-e2e (push) Failing after 1m28s

This commit is contained in:
2026-06-27 21:01:52 +09:00
parent f29f2c3cff
commit bfad47c2af
2 changed files with 0 additions and 58 deletions
@@ -32,10 +32,6 @@ public class BlogController : ControllerBase
return Ok(post);
}
[HttpGet("~/blog/{slug}")]
public IActionResult RedirectToBlogPage(string slug)
=> RedirectPermanent($"/taxbaik/blog/{slug}");
[HttpGet("admin/all")]
[Authorize]
public async Task<IActionResult> GetAll()
-54
View File
@@ -142,60 +142,6 @@ if (!app.Environment.IsDevelopment())
app.MapControllers();
app.MapHealthChecks("/healthz");
app.MapRazorPages();
app.MapGet("/blog/{slug}", async (string slug, TaxBaik.Application.Services.BlogService blogService, HttpContext context) =>
{
var post = await blogService.GetBySlugAsync(slug, context.RequestAborted);
if (post == null)
return Results.NotFound();
var baseUrl = $"{context.Request.Scheme}://{context.Request.Host}{context.Request.PathBase}";
var canonical = $"{baseUrl}/blog/{post.Slug}";
var html = $"""
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>{System.Net.WebUtility.HtmlEncode(post.SeoTitle ?? post.Title)}</title>
<meta name="description" content="{System.Net.WebUtility.HtmlEncode(post.SeoDescription ?? string.Empty)}" />
<link rel="canonical" href="{canonical}" />
</head>
<body>
<main>
<h1>{System.Net.WebUtility.HtmlEncode(post.Title)}</h1>
</main>
</body>
</html>
""";
return Results.Content(html, "text/html; charset=utf-8");
});
app.MapGet("/taxbaik/blog/{slug}", async (string slug, TaxBaik.Application.Services.BlogService blogService, HttpContext context) =>
{
var post = await blogService.GetBySlugAsync(slug, context.RequestAborted);
if (post == null)
return Results.NotFound();
var baseUrl = $"{context.Request.Scheme}://{context.Request.Host}{context.Request.PathBase}";
var canonical = $"{baseUrl}/blog/{post.Slug}";
var html = $"""
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>{System.Net.WebUtility.HtmlEncode(post.SeoTitle ?? post.Title)}</title>
<meta name="description" content="{System.Net.WebUtility.HtmlEncode(post.SeoDescription ?? string.Empty)}" />
<link rel="canonical" href="{canonical}" />
</head>
<body>
<main>
<h1>{System.Net.WebUtility.HtmlEncode(post.Title)}</h1>
</main>
</body>
</html>
""";
return Results.Content(html, "text/html; charset=utf-8");
});
app.MapRazorComponents<TaxBaik.Web.Components.Admin.App>().AddInteractiveServerRenderMode();
app.Run();