Ai
4 Star 24 Fork 2

IoTSharp/Extensions.Configuration.GitRepository

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Startup.cs 1.39 KB
一键复制 编辑 原始数据 按行查看 历史
namespace DemoUseStartup
{
public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public IConfiguration Configuration { get; }
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
Console.WriteLine($"abc={Configuration.GetValue<string>("abc")}");
// Add services to the container.
services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
services.AddEndpointsApiExplorer();
services.AddSwaggerGen();
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
// Configure the HTTP request pipeline.
if (env.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
app.UseRouting();
app.UseAuthorization();
app.UseEndpoints(cfg =>
{
cfg.MapControllers();
});
app.UseStaticFiles();
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/IoTSharp/Extensions.Configuration.GitRepository.git
git@gitee.com:IoTSharp/Extensions.Configuration.GitRepository.git
IoTSharp
Extensions.Configuration.GitRepository
Extensions.Configuration.GitRepository
main

搜索帮助