Created
April 22, 2022 12:14
-
-
Save alikrc/f0f6b4b0c80bf9b1f834a28e0e7d8071 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using MassTransit; | |
var builder = WebApplication.CreateBuilder(args); | |
builder.Services.AddControllers(); | |
builder.Services.AddEndpointsApiExplorer(); | |
builder.Services.AddSwaggerGen(); | |
builder.Services.AddMassTransit(busConfigurator => | |
{ | |
busConfigurator.SetKebabCaseEndpointNameFormatter(); | |
busConfigurator.UsingRabbitMq((context, busFactoryConfigurator) => | |
{ | |
busFactoryConfigurator.Host("rabbitmq", hostConfigurator => { }); | |
}); | |
}); | |
var app = builder.Build(); | |
if (app.Environment.IsDevelopment()) { | |
app.UseSwagger(); | |
app.UseSwaggerUI(); | |
} | |
app.UseHttpsRedirection(); | |
app.UseAuthorization(); | |
app.MapControllers(); | |
app.Run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment