mirror of
https://github.com/volodymyrsmirnov/MalwareMultiScan.git
synced 2025-08-25 22:01:16 +00:00
refactoring, documentation pending
This commit is contained in:
@@ -18,7 +18,7 @@ namespace MalwareMultiScan.Api
|
||||
{
|
||||
_configuration = configuration;
|
||||
}
|
||||
|
||||
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddSingleton(x =>
|
||||
@@ -26,7 +26,7 @@ namespace MalwareMultiScan.Api
|
||||
|
||||
services.AddSingleton<ScanBackendService>();
|
||||
services.AddSingleton<ScanResultService>();
|
||||
|
||||
|
||||
services.AddSingleton(
|
||||
serviceProvider =>
|
||||
{
|
||||
@@ -35,7 +35,7 @@ namespace MalwareMultiScan.Api
|
||||
return db.GetDatabase(
|
||||
_configuration.GetValue<string>("DatabaseName"));
|
||||
});
|
||||
|
||||
|
||||
services.AddControllers();
|
||||
services.AddHttpClient();
|
||||
|
||||
@@ -48,14 +48,14 @@ namespace MalwareMultiScan.Api
|
||||
Version = "1.0.0"
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
services.AddHostedService<ReceiverHostedService>();
|
||||
}
|
||||
|
||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||
{
|
||||
app.UseRouting();
|
||||
|
||||
|
||||
var forwardingOptions = new ForwardedHeadersOptions
|
||||
{
|
||||
ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto
|
||||
@@ -67,13 +67,13 @@ namespace MalwareMultiScan.Api
|
||||
app.UseForwardedHeaders(forwardingOptions);
|
||||
|
||||
app.UseEndpoints(endpoints => endpoints.MapControllers());
|
||||
|
||||
|
||||
app.UseSwagger();
|
||||
|
||||
app.UseSwaggerUI(options =>
|
||||
{
|
||||
options.DocumentTitle = "MalwareMultiScan";
|
||||
|
||||
|
||||
options.SwaggerEndpoint(
|
||||
$"/swagger/{options.DocumentTitle}/swagger.json", options.DocumentTitle);
|
||||
});
|
||||
|
Reference in New Issue
Block a user