aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Program.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2019-02-09 23:08:46 +0800
committercrupest <crupest@outlook.com>2019-02-09 23:08:46 +0800
commit44645b381ffe399e444444cc0011287d4e09fd7e (patch)
tree7e75b25424c25238affebf39cf0263b522915c67 /Timeline/Program.cs
parentf248b20975f234d25e5a6ef57a7e6739f7999d14 (diff)
downloadtimeline-44645b381ffe399e444444cc0011287d4e09fd7e.tar.gz
timeline-44645b381ffe399e444444cc0011287d4e09fd7e.tar.bz2
timeline-44645b381ffe399e444444cc0011287d4e09fd7e.zip
Add config.
Diffstat (limited to 'Timeline/Program.cs')
-rw-r--r--Timeline/Program.cs10
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) =>