|
|
|
@ -24,7 +24,7 @@ builder.Services.AddControllers();
|
|
|
|
|
builder.Services.AddEndpointsApiExplorer();
|
|
|
|
|
builder.Services.AddSwaggerGen();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
builder.Services.AddMvc();
|
|
|
|
|
builder.Services.AddDbContext<StubbedContext>(options =>
|
|
|
|
|
{
|
|
|
|
|
options.UseSqlServer(builder.Configuration.GetConnectionString("StubbedContext"));
|
|
|
|
@ -32,7 +32,7 @@ builder.Services.AddDbContext<StubbedContext>(options =>
|
|
|
|
|
|
|
|
|
|
builder.Services.AddSwaggerGen(option =>
|
|
|
|
|
{
|
|
|
|
|
option.SwaggerDoc("v1", new OpenApiInfo { Title = "Test API", Version = "v1" });
|
|
|
|
|
option.SwaggerDoc("v1", new OpenApiInfo { Title = "API", Version = "v1" });
|
|
|
|
|
option.AddSecurityDefinition("Bearer", new OpenApiSecurityScheme
|
|
|
|
|
{
|
|
|
|
|
In = ParameterLocation.Header,
|
|
|
|
@ -42,6 +42,8 @@ builder.Services.AddSwaggerGen(option =>
|
|
|
|
|
BearerFormat = "JWT",
|
|
|
|
|
Scheme = "Bearer"
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
option.AddSecurityRequirement(new OpenApiSecurityRequirement
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
@ -92,9 +94,9 @@ builder.Services.AddApiVersioning(o =>
|
|
|
|
|
o.ReportApiVersions = true;
|
|
|
|
|
});
|
|
|
|
|
builder.Services.AddScoped<IGroupService, GroupService>();
|
|
|
|
|
builder.Services.AddScoped<IService<LangueDTO>,LangueService>();
|
|
|
|
|
builder.Services.AddScoped<IService<RoleDTO>,RoleService>();
|
|
|
|
|
builder.Services.AddScoped<ITranslateService,TranslateService>();
|
|
|
|
|
builder.Services.AddScoped<IService<LangueDTO>, LangueService>();
|
|
|
|
|
builder.Services.AddScoped<IService<RoleDTO>, RoleService>();
|
|
|
|
|
builder.Services.AddScoped<ITranslateService, TranslateService>();
|
|
|
|
|
builder.Services.AddScoped<IUserService, UserService>();
|
|
|
|
|
builder.Services.AddScoped<IVocabularyService, VocabularyService>();
|
|
|
|
|
builder.Services.AddScoped<IVocabularyListService, VocabularyListService>();
|
|
|
|
@ -106,10 +108,14 @@ if (app.Environment.IsDevelopment())
|
|
|
|
|
app.UseSwaggerUI();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
app.UseSwaggerUI(c =>
|
|
|
|
|
{
|
|
|
|
|
c.SwaggerEndpoint("v1/swagger.json", "API V1");
|
|
|
|
|
});
|
|
|
|
|
app.UseAuthentication();
|
|
|
|
|
|
|
|
|
|
app.UseHttpsRedirection();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app.UseAuthorization();
|
|
|
|
|
|
|
|
|
|
app.MapControllers();
|
|
|
|
|