-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
35 lines (23 loc) · 969 Bytes
/
Program.cs
File metadata and controls
35 lines (23 loc) · 969 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System.Collections.Immutable;
using System.Configuration;
using ZLogger;
using com2us_start;
using com2us_start.Middleware;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddControllers();
builder.Services.AddMemoryCache();
builder.Logging.ClearProviders();
builder.Logging.AddZLoggerConsole();
//builder.Logging.AddConsole();
//AddScoped: 단일 요청에서 공유하고 다른 요청에선 새 인스턴스 생성
builder.Services.AddScoped<IRealDbConnector, RealDbConnector>();
builder.Services.AddScoped<IRealRedisConnector, RealRedisConnector>();
var app = builder.Build();
app.UseRouting();
app.UseLoggingMiddleware();
app.UseTokenCheckMiddleware();
app.UseEndpoints(endpoints => { endpoints.MapControllers(); });
IConfiguration configuration = app.Configuration;
RealRedisConnector rc = new RealRedisConnector(configuration);
await CsvTableLoader.Instance.Init(configuration);
app.Run();