diff options
author | crupest <crupest@outlook.com> | 2019-02-09 23:08:46 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2019-02-09 23:08:46 +0800 |
commit | de90f0413553a23f8ebba1343c6e96c63e0c9748 (patch) | |
tree | 98c1c67c3d7849da66c3e20bf94d57441196e71f | |
parent | e6fbea6231c6918bfabbf7118f816d8aa2491f07 (diff) | |
download | timeline-de90f0413553a23f8ebba1343c6e96c63e0c9748.tar.gz timeline-de90f0413553a23f8ebba1343c6e96c63e0c9748.tar.bz2 timeline-de90f0413553a23f8ebba1343c6e96c63e0c9748.zip |
Add config.
-rw-r--r-- | Timeline/Program.cs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Timeline/Program.cs b/Timeline/Program.cs index 575ddc81..8ee8822a 100644 --- a/Timeline/Program.cs +++ b/Timeline/Program.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.Logging; +using Microsoft.Extensions.FileProviders; namespace Timeline { @@ -14,7 +14,13 @@ namespace Timeline { public static void Main(string[] args) { - CreateWebHostBuilder(args).Build().Run(); + CreateWebHostBuilder(args) + .ConfigureAppConfiguration((context, config) => + { + if (context.HostingEnvironment.IsProduction()) + config.AddJsonFile(new PhysicalFileProvider("/etc/webapp/timeline/"), "config.json", true, true); + }) + .Build().Run(); } public static IWebHostBuilder CreateWebHostBuilder(string[] args) => |