This commit is contained in:
@@ -4,7 +4,6 @@ using System.Text.Encodings.Web;
|
||||
using System.Text.Unicode;
|
||||
using Microsoft.AspNetCore.Authentication.Cookies;
|
||||
using Microsoft.AspNetCore.Authentication.OAuth;
|
||||
using Microsoft.AspNetCore.Components.Authorization;
|
||||
using Microsoft.AspNetCore.HttpOverrides;
|
||||
using Microsoft.AspNetCore.RateLimiting;
|
||||
using Microsoft.AspNetCore.ResponseCompression;
|
||||
@@ -76,10 +75,6 @@ builder.Services.AddRateLimiter(options =>
|
||||
// Razor Pages
|
||||
builder.Services.AddRazorPages();
|
||||
|
||||
// Blazor WebAssembly Components (WASM 렌더링 모드 지원)
|
||||
builder.Services.AddRazorComponents()
|
||||
.AddInteractiveWebAssemblyComponents();
|
||||
|
||||
// Session & TempData (쿠키 저장소)
|
||||
builder.Services.AddSession(options =>
|
||||
{
|
||||
@@ -304,31 +299,6 @@ catch (Exception ex)
|
||||
|
||||
// PathBase는 사용하지 않음
|
||||
|
||||
// 개발 및 테스트 환경에서 resource-collection.js 404로 인해 Blazor WASM이 크래시되는 현상 방지
|
||||
app.Use(async (context, next) =>
|
||||
{
|
||||
var path = context.Request.Path.Value ?? string.Empty;
|
||||
if (path.Equals("/_framework/blazor-hotreload", StringComparison.OrdinalIgnoreCase) ||
|
||||
path.Equals("/admin/_framework/blazor-hotreload", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
context.Response.StatusCode = StatusCodes.Status204NoContent;
|
||||
return;
|
||||
}
|
||||
if (path.Contains("resource-collection") && path.EndsWith(".js"))
|
||||
{
|
||||
context.Response.ContentType = "application/javascript";
|
||||
await context.Response.WriteAsync("""
|
||||
export function get() {
|
||||
return [];
|
||||
}
|
||||
|
||||
export default { get };
|
||||
""");
|
||||
return;
|
||||
}
|
||||
await next();
|
||||
});
|
||||
|
||||
app.UseResponseCompression();
|
||||
|
||||
// WASM 디버깅/Hot Reload는 명시적으로 켠 경우에만 주입한다.
|
||||
@@ -339,9 +309,8 @@ if (app.Environment.IsDevelopment() && enableWebAssemblyDebugging)
|
||||
app.UseWebAssemblyDebugging();
|
||||
}
|
||||
|
||||
// 정적 파일 제공 (WASM 프레임워크 파일 포함)
|
||||
// 정적 파일 제공
|
||||
app.UseStaticFiles();
|
||||
app.UseStaticFiles("/admin");
|
||||
app.UseStaticFiles("/portal");
|
||||
|
||||
app.UseSession(); // TempData 쿠키 저장소
|
||||
|
||||
Reference in New Issue
Block a user