49 lines
1.2 KiB
C#
49 lines
1.2 KiB
C#
using FictionArchive.Service.Shared;
|
|
using FictionArchive.Service.Shared.Services.EventBus.Implementations;
|
|
|
|
namespace FictionArchive.Service.AuthenticationService;
|
|
|
|
public class Program
|
|
{
|
|
public static void Main(string[] args)
|
|
{
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
// Add services to the container.
|
|
|
|
builder.Services.AddControllers();
|
|
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
|
builder.Services.AddEndpointsApiExplorer();
|
|
builder.Services.AddSwaggerGen();
|
|
|
|
#region Event Bus
|
|
|
|
builder.Services.AddRabbitMQ(opt =>
|
|
{
|
|
builder.Configuration.GetSection("RabbitMQ").Bind(opt);
|
|
});
|
|
|
|
#endregion
|
|
|
|
builder.Services.AddHealthChecks();
|
|
|
|
var app = builder.Build();
|
|
|
|
// Configure the HTTP request pipeline.
|
|
if (app.Environment.IsDevelopment())
|
|
{
|
|
app.UseSwagger();
|
|
app.UseSwaggerUI();
|
|
}
|
|
|
|
app.UseHttpsRedirection();
|
|
|
|
app.MapHealthChecks("/healthz");
|
|
|
|
app.UseAuthorization();
|
|
|
|
app.MapControllers();
|
|
|
|
app.Run();
|
|
}
|
|
} |