Revize 02d9bb40
Přidáno uživatelem Vojtěch Bartička před asi 3 roky(ů)
Backend/Backend/Program.cs | ||
---|---|---|
29 | 29 |
builder.Services.AddSwaggerGen(c => |
30 | 30 |
{ |
31 | 31 |
c.SwaggerDoc("v1", |
32 |
new OpenApiInfo {Title = "AnnotationTool", Description = "KIV/ASWI ZČU Plzeň, 2022", Version = "0.1.1"});
|
|
32 |
new OpenApiInfo { Title = "AnnotationTool", Description = "KIV/ASWI ZČU Plzeň, 2022", Version = "0.1.1" });
|
|
33 | 33 |
}); |
34 | 34 |
|
35 | 35 |
// JWT authentication |
... | ... | |
51 | 51 |
|
52 | 52 |
builder.Services.AddHttpContextAccessor(); |
53 | 53 |
builder.Services.AddScoped<User>(provider => |
54 |
((User?) provider.GetRequiredService<IHttpContextAccessor>().HttpContext?.Items["User"]));
|
|
54 |
((User?)provider.GetRequiredService<IHttpContextAccessor>().HttpContext?.Items["User"])); |
|
55 | 55 |
|
56 | 56 |
// Database |
57 | 57 |
builder.Services.AddDbContext<DatabaseContext>(); |
Také k dispozici: Unified diff
Formatting