Ejemplo n.º 1
0
        static void Main()
        {
            // Spawn logger
            loggerFactory = LoggerFactory.Create(logBuilder =>
                                                 logBuilder.AddSimpleConsole(logOptions => {
                logOptions.IncludeScopes   = true;
                logOptions.SingleLine      = true;
                logOptions.TimestampFormat = "hh:mm:ss ";
            }));
            logger = loggerFactory.CreateLogger <Program>();
            logger.LogInformation("Initializing...");

            // Spawn SimConnect client
            logger.LogInformation("Spawning SimConnect client...");
            simConnectClient = SimConnectClient.Instance;
            simConnectClient.Start();

            // Start REST API
            CreateHostBuilder().Build().Run();

            // Housekeeper
            logger.LogInformation("Cleaning up...");
            simConnectClient.Stop();
            logger.LogInformation("All done. Exiting.");
            Environment.Exit(0);
        }
Ejemplo n.º 2
0
 public RestController()
 {
     simConnectClient = SimConnectClient.Instance;
 }