Archived
Private
Public Access
1
0

Update 07.12.2022

This commit is contained in:
2022-12-07 15:35:41 +01:00
parent 771f58073f
commit 840d7ad42f
288 changed files with 148948 additions and 4346 deletions

View File

@@ -0,0 +1,35 @@
using Microsoft.Extensions.DependencyInjection.Extensions;
using ProjectManager.Backend;
using ProjectManager.Backend.Options;
using ProjectManager.Backend.Security;
using ProjectManager.Backend.Storage;
var builder = WebApplication.CreateBuilder(args);
// Add options to the container
builder.Services.AddOptionsFromConfiguration<GeneralOptions>(builder.Configuration);
// Add services to the container.
builder.Services.AddDbContext<DatabaseContext>();
builder.Services.TryAddSingleton<IHttpContextAccessor, HttpContextAccessor>();
builder.Services.AddScoped<ITokenContext, TokenContext>();
builder.Services.AddScoped<IUserApi, UserApi>();
builder.Services.AddScoped<ITokenApi, TokenApi>();
builder.Services.AddCustomAuthentication(true);
builder.Services.AddControllers();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment()) {
app.UseSwagger();
app.UseSwaggerUI();
}
app.UseAuthorization();
app.MapControllers();
app.Run();