Add Worker background service to log periodic messages

Added a Worker class in EnvelopeGenerator.ServiceHost that logs an informational message every second. Registered the Worker as a hosted service in Program.cs to run alongside the web API.
This commit is contained in:
2026-02-23 11:10:15 +01:00
parent e385fdda95
commit c8834dc3be
2 changed files with 24 additions and 0 deletions

View File

@@ -5,6 +5,7 @@ var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllers();
builder.Services.AddHostedService<Worker>();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();