mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 18:46:31 +00:00
28 lines
758 B
C#
28 lines
758 B
C#
using Azaion.Repository;
|
|
using Azaion.Repository.DTO;
|
|
using Azaion.Video;
|
|
using Microsoft.Extensions.Options;
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
builder.Services.AddControllers();
|
|
builder.Services.AddEndpointsApiExplorer();
|
|
builder.Services.AddSwaggerGen();
|
|
|
|
builder.Services.Configure<ConnectionStrings>(builder.Configuration.GetSection(nameof(ConnectionStrings)));
|
|
builder.Services.AddSingleton<IDbFactory, DbFactory>(sp => new DbFactory(sp.GetService<IOptions<ConnectionStrings>>()!.Value.FraudDb!));
|
|
builder.Services.AddScoped<IVideoManager, VideoManager>();
|
|
|
|
var app = builder.Build();
|
|
|
|
if (app.Environment.IsDevelopment())
|
|
{
|
|
app.UseSwagger();
|
|
app.UseSwaggerUI();
|
|
}
|
|
|
|
app.UseHttpsRedirection();
|
|
|
|
app.MapControllers();
|
|
app.Run();
|