forked from AcaMate/AcaMate_Web
1. 쿠키만 사용하던 저장 동작을 다른 저장소도 사용하게 변경 1.1. 쿠키 대신 세션 레포지토리를 기본적으로 사용하게 Service 코드 구현 2. 로그인 되었을 경우 화면 표기 변경 2.1. 시작하기 버튼 hidden 처리 2.2. 사용자 이름 불러오기 2.3. 로그인 동작 관련 변수 스토리지 저장 2.4. 서버에서 직접적인 크라이언트 쿠키 저장이 아닌 서버는 뒤의 값으로 간섭하게 변경
44 lines
1.4 KiB
C#
44 lines
1.4 KiB
C#
using Microsoft.AspNetCore.Components.Web;
|
|
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
|
|
using Microsoft.Extensions.Configuration;
|
|
|
|
using Front;
|
|
using Front.Program.Services;
|
|
|
|
var builder = WebAssemblyHostBuilder.CreateDefault(args);
|
|
|
|
builder.RootComponents.Add<App>("#app");
|
|
builder.RootComponents.Add<HeadOutlet>("head::after");
|
|
|
|
// 설정 파일 로드
|
|
// builder.Configuration.AddJsonFile("appsettings.json", optional: false);
|
|
builder.Configuration.AddJsonFile($"appsettings.{builder.HostEnvironment.Environment}.json", optional: true);
|
|
|
|
builder.Services.AddScoped(sp => //new HttpClient
|
|
{
|
|
|
|
|
|
var config = builder.Configuration;
|
|
var http = new HttpClient
|
|
{
|
|
// BaseAddress = new Uri("http://0.0.0.0:5144")
|
|
BaseAddress = new Uri("https://devacamate.ipstein.myds.me")
|
|
// BaseAddress = builder.HostEnvironment.IsDevelopment()
|
|
// ? new Uri("https://devacamate.ipstein.myds.me")
|
|
// : new Uri("https://acamate.ipstein.myds.me")
|
|
|
|
};
|
|
return http;
|
|
});
|
|
|
|
// SCOPED 으로 등록된 서비스는 DI 컨테이너에 등록된 서비스의 인스턴스를 사용합니다.
|
|
builder.Services.AddScoped<APIService>();
|
|
builder.Services.AddScoped<SecureService>();
|
|
builder.Services.AddScoped<StorageService>();
|
|
// builder.Services.AddRazorPages();
|
|
// builder.Services.AddServerSideBlazor();
|
|
builder.Services.AddScoped<LoadingService>();
|
|
|
|
|
|
await builder.Build().RunAsync();
|