휴가 신청 삭제시 로그파일에 기록되도록 함

This commit is contained in:
ChiKyun Kim
2025-10-29 10:43:28 +09:00
parent 6bd4f84192
commit 3f3a2834df
51 changed files with 1321 additions and 5365 deletions

View File

@@ -16,7 +16,44 @@ namespace Project.OWIN
{
public void Configuration(IAppBuilder app)
{
// Configure Web API for Self-Host
app.UseCors(Microsoft.Owin.Cors.CorsOptions.AllowAll);
// 정적 파일 서빙을 가장 먼저 설정 (다른 모든 미들웨어보다 우선)
var staticFileOptions = new FileServerOptions
{
EnableDefaultFiles = true,
DefaultFilesOptions = { DefaultFileNames = { "index.html" } },
FileSystem = new Microsoft.Owin.FileSystems.PhysicalFileSystem("Web/wwwroot"),
RequestPath = Microsoft.Owin.PathString.Empty
};
app.UseFileServer(staticFileOptions);
// 캐시 방지 미들웨어 (정적 파일이 처리되지 않은 경우에만 적용)
app.Use(async (context, next) =>
{
var path = context.Request.Path.Value;
if (path.EndsWith(".js") ||
path.EndsWith(".css") ||
path.EndsWith(".jsx") ||
path.EndsWith(".tsx") ||
path.EndsWith(".html"))
{
context.Response.Headers["Cache-Control"] = "no-cache, no-store, must-revalidate";
context.Response.Headers["Pragma"] = "no-cache";
context.Response.Headers["Expires"] = "0";
}
// JSX/TSX 파일을 JavaScript로 처리
if (path.EndsWith(".jsx") || path.EndsWith(".tsx"))
{
context.Response.ContentType = "application/javascript";
}
await next();
});
// Configure Web API for Self-Host (정적 파일 후에 설정)
HttpConfiguration config = new HttpConfiguration();
//라우팅 설정
@@ -41,31 +78,8 @@ namespace Project.OWIN
// 파일 업로드 설정
config.Formatters.Remove(config.Formatters.XmlFormatter);
app.UseCors(Microsoft.Owin.Cors.CorsOptions.AllowAll);
app.UseWebApi(config);
// 캐시 방지 미들웨어 추가 (정적 파일 서빙 전에 적용)
app.Use(async (context, next) =>
{
if (context.Request.Path.Value.EndsWith(".js") || context.Request.Path.Value.EndsWith(".css"))
{
context.Response.Headers["Cache-Control"] = "no-cache, no-store, must-revalidate";
context.Response.Headers["Pragma"] = "no-cache";
context.Response.Headers["Expires"] = "0";
}
await next();
});
// 정적 파일 서빙 설정
var options = new FileServerOptions
{
EnableDefaultFiles = true,
DefaultFilesOptions = { DefaultFileNames = { "index.html" } },
FileSystem = new Microsoft.Owin.FileSystems.PhysicalFileSystem("Web/wwwroot")
};
app.UseFileServer(options);
//appBuilder.UseFileServer(new FileServerOptions
//{
// RequestPath = new PathString(string.Empty),