Add background service and update project configuration
Added a `Worker` class as a hosted background service to log periodic messages. Updated `DigitalData.EmailProfiler.API.csproj` to include `UserSecretsId` for secure development storage and added `Microsoft.Extensions.Hosting` package. Replaced the `Controllers` folder reference with `Properties`. Updated `Program.cs` to register the `Worker` service, enable API exploration, and retain Swagger configuration.
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
using DigitalData.EmailProfiler.API;
|
||||
|
||||
// Add services to the container.
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
builder.Services.AddHostedService<Worker>();
|
||||
|
||||
builder.Services.AddControllers();
|
||||
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
||||
|
||||
builder.Services.AddEndpointsApiExplorer();
|
||||
builder.Services.AddSwaggerGen();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user