31 lines
707 B
C#
31 lines
707 B
C#
|
|
using Nacos.AspNetCore.V2;
|
|||
|
|
|
|||
|
|
var builder = WebApplication.CreateBuilder(args);
|
|||
|
|
|
|||
|
|
// Add services to the container.
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
builder.Configuration.AddNacosV2Configuration(builder.Configuration.GetSection("NacosConfig"));
|
|||
|
|
//<2F><><EFBFBD><EFBFBD>ע<EFBFBD><D7A2>
|
|||
|
|
builder.Services.AddNacosAspNet(builder.Configuration);
|
|||
|
|
|
|||
|
|
|
|||
|
|
builder.Services.AddControllers();
|
|||
|
|
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
|||
|
|
builder.Services.AddEndpointsApiExplorer();
|
|||
|
|
builder.Services.AddSwaggerGen();
|
|||
|
|
|
|||
|
|
var app = builder.Build();
|
|||
|
|
|
|||
|
|
// Configure the HTTP request pipeline.
|
|||
|
|
if (app.Environment.IsDevelopment())
|
|||
|
|
{
|
|||
|
|
app.UseSwagger();
|
|||
|
|
app.UseSwaggerUI();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
app.UseAuthorization();
|
|||
|
|
|
|||
|
|
app.MapControllers();
|
|||
|
|
|
|||
|
|
app.Run();
|