Dipper/Dipper.Demo/Program.cs

30 lines
576 B
C#
Raw Permalink Normal View History

2022-11-09 22:06:06 +08:00
using Dipper.Alioth;
2022-11-27 18:05:18 +08:00
using Dipper.Alioth.Extensions;
using Dipper.Alioth.Services;
2022-11-09 22:06:06 +08:00
using Dipper.Alioth.Web;
2022-11-27 17:23:54 +08:00
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddControllers();
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
builder.AddStarApp(option =>
{
option.Asterisms.Add(new DomainAsterism());
});
var app = builder.Build();
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
app.UseHttpsRedirection();
app.UseAuthorization();
app.MapControllers();
app.UseStarApp();
app.Run();