配置文件升级+修改(重要更新!)
This commit is contained in:
30
U8Server/Program.cs
Normal file
30
U8Server/Program.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
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();
|
||||
Reference in New Issue
Block a user