mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-19 02:53:06 +08:00
MQTTnet.Server startup cleanup.
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Threading;
|
|
||||||
using Microsoft.AspNetCore;
|
using Microsoft.AspNetCore;
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
|
|
||||||
@@ -14,7 +13,8 @@ namespace MQTTnet.Server
|
|||||||
{
|
{
|
||||||
PrintLogo();
|
PrintLogo();
|
||||||
|
|
||||||
CreateWebHostBuilder(args).Build().Run();
|
WebHost.CreateDefaultBuilder(args).UseStartup<Startup>().Build().Run();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
@@ -24,17 +24,12 @@ namespace MQTTnet.Server
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
|
|
||||||
WebHost.CreateDefaultBuilder(args)
|
|
||||||
.UseKestrel()
|
|
||||||
.UseStartup<Startup>();
|
|
||||||
|
|
||||||
private static void PrintLogo()
|
private static void PrintLogo()
|
||||||
{
|
{
|
||||||
Console.ResetColor();
|
Console.ResetColor();
|
||||||
Console.ForegroundColor = ConsoleColor.White;
|
Console.ForegroundColor = ConsoleColor.White;
|
||||||
Console.BackgroundColor = ConsoleColor.Red;
|
Console.BackgroundColor = ConsoleColor.Red;
|
||||||
var logoText =
|
const string LogoText =
|
||||||
@"| |
|
@"| |
|
||||||
| __ __ ____ _______ _______ _ _____ |
|
| __ __ ____ _______ _______ _ _____ |
|
||||||
| | \/ |/ __ \__ __|__ __| | | / ____| |
|
| | \/ |/ __ \__ __|__ __| | | / ____| |
|
||||||
@@ -44,12 +39,8 @@ namespace MQTTnet.Server
|
|||||||
| |_| |_|\___\_\ |_| |_|_| |_|\___|\__| |_____/ \___|_| \_/ \___|_| |
|
| |_| |_|\___\_\ |_| |_|_| |_|\___|\__| |_____/ \___|_| \_/ \___|_| |
|
||||||
| |
|
| |
|
||||||
| |";
|
| |";
|
||||||
foreach (var @char in logoText)
|
|
||||||
{
|
|
||||||
Console.Write(@char);
|
|
||||||
Thread.Sleep(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
Console.WriteLine(LogoText);
|
||||||
Console.ResetColor();
|
Console.ResetColor();
|
||||||
Console.WriteLine();
|
Console.WriteLine();
|
||||||
Console.ForegroundColor = ConsoleColor.White;
|
Console.ForegroundColor = ConsoleColor.White;
|
||||||
|
|||||||
Reference in New Issue
Block a user