mirror of
https://github.com/volodymyrsmirnov/MalwareMultiScan.git
synced 2025-08-23 21:12:22 +00:00
34 lines
877 B
C#
34 lines
877 B
C#
using Hangfire;
|
|
using Hangfire.MemoryStorage;
|
|
using MalwareMultiScan.Worker.Jobs;
|
|
using Microsoft.AspNetCore.Builder;
|
|
using Microsoft.AspNetCore.Hosting;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
namespace MalwareMultiScan.Worker
|
|
{
|
|
public class Startup
|
|
{
|
|
public void ConfigureServices(IServiceCollection services)
|
|
{
|
|
services.AddLogging();
|
|
services.AddControllers();
|
|
|
|
services.AddSingleton<ScanJob>();
|
|
|
|
services.AddHangfire(
|
|
configuration => configuration.UseMemoryStorage());
|
|
|
|
services.AddHangfireServer();
|
|
}
|
|
|
|
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
|
{
|
|
app.UseRouting();
|
|
|
|
app.UseEndpoints(endpoints => { endpoints.MapControllers(); });
|
|
|
|
app.UseHangfireServer();
|
|
}
|
|
}
|
|
} |