dotnetcron/Program.cs

24 lines
727 B
C#
Raw Permalink Normal View History

2017-07-06 09:03:51 +00:00
using System;
using System.IO;
using Microsoft.Extensions.Configuration;
2017-07-06 09:03:51 +00:00
namespace DotNetCron
2017-07-06 09:03:51 +00:00
{
class Program
{
static void Main(string[] args)
{
var configuration = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.AddJsonFile("appsettings.json", optional:true, reloadOnChange:true)
2017-09-26 21:10:02 +00:00
.AddEnvironmentVariables(prefix: "CRON_")
.Build();
var consoleSettings = new ConsoleSettings();
configuration.GetSection("Console").Bind(consoleSettings);
Console.WriteLine($"{DateTime.UtcNow}: Output String: '{consoleSettings.OutputString}'");
2017-07-06 09:03:51 +00:00
}
}
}