-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
482 additions
and
296 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,27 @@ | ||
using System; | ||
using System.IO; | ||
using Consul; | ||
using System.IO; | ||
using Extensions.Configuration.Consul; | ||
using Microsoft.AspNetCore; | ||
using Microsoft.AspNetCore.Hosting; | ||
using Microsoft.Extensions.Configuration; | ||
|
||
namespace Example | ||
{ | ||
public class Program | ||
{ | ||
public static void Main(string[] args) | ||
{ | ||
CreateWebHostBuilder(args).Build().Run(); | ||
ConsulConfigurationExtensions.Shutdown(); | ||
} | ||
public static IWebHostBuilder CreateWebHostBuilder(string[] args) => | ||
public class Program | ||
{ | ||
public static void Main(string[] args) | ||
{ | ||
CreateWebHostBuilder(args).Build().Run(); | ||
} | ||
public static IWebHostBuilder CreateWebHostBuilder(string[] args) => | ||
|
||
WebHost.CreateDefaultBuilder(args).ConfigureAppConfiguration((context, config) => | ||
{ | ||
config.SetBasePath(Directory.GetCurrentDirectory()); | ||
config.AddCommandLine(args); | ||
config.AddJsonFile("appsettings.json", false, true); | ||
config.AddJsonFile($"appsettings.{context.HostingEnvironment.EnvironmentName}.json", false, true); | ||
config.AddConsul(new ConsulClientConfiguration | ||
{ | ||
Address = new Uri("http://192.168.1.142:8500") | ||
}, new ConsulQueryOptions | ||
{ | ||
Prefix = "AppSetting/", | ||
TrimPrefix = true | ||
}, true); | ||
}).UseStartup<Startup>(); | ||
} | ||
WebHost.CreateDefaultBuilder(args).ConfigureAppConfiguration((context, config) => | ||
{ | ||
config.SetBasePath(Directory.GetCurrentDirectory()); | ||
config.AddJsonFile("appsettings.json", false, true); | ||
config.AddJsonFile($"appsettings.{context.HostingEnvironment.EnvironmentName}.json", false, true); | ||
//config.AddConsul("http://192.168.1.133:8500"); | ||
config.AddConsul(args); | ||
config.AddCommandLine(args); | ||
}).UseStartup<Startup>(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 0 additions & 47 deletions
47
src/Extensions.Configuration.Consul/ConsulConfigurationExtensions.cs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.