Apollo系列(二):Apollo在ASP.NET Core 3.1中使用
2024-09-07 09:22:18
关于Apollo怎么安装,我就不介绍,可以看这篇文章:https://www.cnblogs.com/vic-tory/p/13736192.html
一.Apollo使用:
1.创建项目
2.添加配置
3.发布
二.ASP.NET Core客户端使用Apoolo
1.配置
{
"apollo": {
"AppId": "apollo-start",
"MetaServer": "http://localhost:8080",
"ConfigServer": [
"http://localhost:8080"
]
}
}
2.安装Nuget包:Com.Ctrip.Framework.Apollo.Configuration
3.使用
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder
.ConfigureAppConfiguration((hostingContext, builder) =>
{
builder
.AddApollo(builder.Build().GetSection("apollo"))
.AddDefault()
.AddNamespace("application");
})
.UseStartup<Startup>();
});
4.效果
最新文章
- 【分布式】Zookeeper的服务器角色
- OpenJudge1700:八皇后问题 //不属于基本法的基本玩意
- delimiter
- org.apache.hadoop.filecache-*
- 关于main函数的定义
- 11.9 noip模拟试题
- Oracle V$SQLAREA
- 从win7到mac os再到win10,体验总结
- IE6/IE7浏览器中";float: right";自动换行的解决方法
- [刷题]Codeforces 785D - Anton and School - 2
- NYOJ--STL--擅长排列的小明(强大的string :: iterator 和next_permutation)
- Ubuntu 安装和使用 Supervisor(进程管理)
- Windows Developer Day - MSIX and Advanced Installer
- UNIX网络编程——非阻塞connect
- Taurus.MVC 支持Asp.Net Core 的过程
- Java代码复用的三种常用方式:继承、组合和代理
- Python学习之路——迭代器
- 2017-9-3模拟赛T3 密码(key)
- Angular 2/4/5+ 重复点击菜单刷新界面
- java高精度学习笔记