forked from AcaMate/AcaMate_API
Compare commits
No commits in common. "d9166469f733f1c4ed951fcc335ece4de06f4a3f" and "5d79cde27f1fc2f85314e07ab945b33d38717822" have entirely different histories.
d9166469f7
...
5d79cde27f
72
.gitignore
vendored
72
.gitignore
vendored
|
@ -11,6 +11,7 @@
|
|||
|
||||
|
||||
|
||||
|
||||
# 기본 파일 및 폴더 제외
|
||||
*.log
|
||||
*.env
|
||||
|
@ -54,11 +55,6 @@ obj/
|
|||
|
||||
# Blazor 관련
|
||||
**/wwwroot/_framework/
|
||||
./wwwroot
|
||||
**/wwwroot
|
||||
**/publish
|
||||
./publish
|
||||
|
||||
|
||||
# Docker 관련
|
||||
docker-compose.override.yml
|
||||
|
@ -66,68 +62,4 @@ Dockerfile
|
|||
|
||||
# 기타 캐시 파일
|
||||
**/*.cache
|
||||
**/*.tmp# 특정 환경에 따라 추가
|
||||
/private/
|
||||
/publish/
|
||||
/bin/
|
||||
/obj/
|
||||
|
||||
./private/
|
||||
./privacy/
|
||||
./publish/
|
||||
./bin/
|
||||
|
||||
|
||||
|
||||
|
||||
# 기본 파일 및 폴더 제외
|
||||
*.log
|
||||
*.env
|
||||
*.bak
|
||||
*.tmp
|
||||
*.swp
|
||||
|
||||
# macOS 관련 파일 제외
|
||||
._
|
||||
._*
|
||||
.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
.Spotlight-V100
|
||||
.Trashes
|
||||
|
||||
# Windows 관련
|
||||
Thumbs.db
|
||||
ehthumbs.db
|
||||
desktop.ini
|
||||
|
||||
# Visual Studio 관련
|
||||
.vscode/
|
||||
.vs/
|
||||
*.suo
|
||||
*.user
|
||||
*.userosscache
|
||||
*.sln.docstates
|
||||
|
||||
# Rider 관련
|
||||
.idea/
|
||||
*.sln.iml
|
||||
|
||||
# .NET 관련
|
||||
bin/
|
||||
obj/
|
||||
*.pdb
|
||||
*.dll
|
||||
*.exe
|
||||
*.nuget/
|
||||
|
||||
# Blazor 관련
|
||||
**/wwwroot/_framework/
|
||||
|
||||
# Docker 관련
|
||||
docker-compose.override.yml
|
||||
Dockerfile
|
||||
|
||||
# 기타 캐시 파일
|
||||
**/*.cache
|
||||
**/*.tmp
|
||||
**/*.tmp
|
22
Program.cs
22
Program.cs
|
@ -4,7 +4,6 @@ using Microsoft.EntityFrameworkCore;
|
|||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
using Microsoft.Extensions.FileProviders;
|
||||
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using System.Net.Http;
|
||||
|
@ -24,7 +23,6 @@ using Back.Program.Services.V1;
|
|||
using Back.Program.Services.V1.Interfaces;
|
||||
|
||||
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
|
||||
|
@ -176,7 +174,6 @@ else
|
|||
///// ===== builder 설정 부 ===== /////
|
||||
|
||||
var app = builder.Build();
|
||||
string staticRoot;
|
||||
|
||||
if (app.Environment.IsDevelopment())
|
||||
{
|
||||
|
@ -184,13 +181,11 @@ if (app.Environment.IsDevelopment())
|
|||
// app.UseSwaggerUI();
|
||||
app.UseCustomSwaggerUI();
|
||||
app.UseDeveloperExceptionPage(); // 좀더 자세한 예외 정보 제공
|
||||
staticRoot = Path.Combine(Directory.GetCurrentDirectory(), "publish", "debug", "wwwroot");
|
||||
}
|
||||
else
|
||||
{
|
||||
app.UseExceptionHandler("/error");
|
||||
app.UseHsts();
|
||||
staticRoot = Path.Combine(Directory.GetCurrentDirectory(), "publish", "release", "wwwroot");
|
||||
}
|
||||
|
||||
// 로컬 테스트 위한 부분 (올릴떄는 켜두기)
|
||||
|
@ -203,31 +198,14 @@ app.UseMiddleware<APIHeaderMiddleware>(
|
|||
(object)new string[] { "iOS_AM_Connect_Key", "And_AM_Connect_Key", "Web_AM_Connect_Key" }
|
||||
);
|
||||
|
||||
// app.UseBlazorFrameworkFiles();
|
||||
// app.UseStaticFiles();
|
||||
|
||||
app.UseStaticFiles(new StaticFileOptions
|
||||
{
|
||||
FileProvider = new PhysicalFileProvider(staticRoot),
|
||||
RequestPath = ""
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
app.UseRouting();
|
||||
app.UseCors("CorsPolicy");
|
||||
app.UseAuthorization();
|
||||
|
||||
app.UseWebSockets();
|
||||
|
||||
app.UseEndpoints(end =>
|
||||
{
|
||||
ControllerEndpointRouteBuilderExtensions.MapControllers(end);
|
||||
|
||||
// 프론트 테스트 위한 부분
|
||||
end.MapFallbackToFile("index.html");
|
||||
|
||||
end.MapHub<ChatHub>("/chatHub");
|
||||
});
|
||||
|
||||
|
|
|
@ -7,11 +7,12 @@ namespace Back.Program.Common.Auth
|
|||
///
|
||||
public class APIHeaderMiddleware
|
||||
{
|
||||
|
||||
private readonly RequestDelegate _next;
|
||||
private readonly string[] _headerNames;
|
||||
// private readonly IHeaderConfig _headerConfig;
|
||||
|
||||
public APIHeaderMiddleware(RequestDelegate next, string[] headerNames) //, IHeaderConfig headerConfig)
|
||||
public APIHeaderMiddleware(RequestDelegate next, string[] headerNames)//, IHeaderConfig headerConfig)
|
||||
{
|
||||
_next = next;
|
||||
_headerNames = headerNames;
|
||||
|
@ -25,10 +26,6 @@ namespace Back.Program.Common.Auth
|
|||
return;
|
||||
}
|
||||
|
||||
// 정적 파일 요청은 미들웨어 건너뜀
|
||||
var path = context.Request.Path.Value;
|
||||
if (path != null && (path.StartsWith("/api")))
|
||||
{
|
||||
// Scoped 사용해서 값 가져오는 곳임
|
||||
var headerConfig = context.RequestServices.GetRequiredService<IHeaderConfig>();
|
||||
|
||||
|
@ -59,11 +56,5 @@ namespace Back.Program.Common.Auth
|
|||
|
||||
await _next(context);
|
||||
}
|
||||
|
||||
{
|
||||
await _next(context);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user