From a9c36ffe713e503b412c6f501bcda4af2d1352d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20G=C3=B3mez=20Cuenca?= Date: Tue, 8 Dec 2020 12:31:24 +0100 Subject: [PATCH] Hotfix for heroku deployment --- Bot_Discord_CSharp/Bot_Discord_CSharp.csproj | 3 +++ Bot_Discord_CSharp/Program.cs | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Bot_Discord_CSharp/Bot_Discord_CSharp.csproj b/Bot_Discord_CSharp/Bot_Discord_CSharp.csproj index 18b83b2..577d7d6 100644 --- a/Bot_Discord_CSharp/Bot_Discord_CSharp.csproj +++ b/Bot_Discord_CSharp/Bot_Discord_CSharp.csproj @@ -6,10 +6,13 @@ + + + diff --git a/Bot_Discord_CSharp/Program.cs b/Bot_Discord_CSharp/Program.cs index 6318961..4d61081 100644 --- a/Bot_Discord_CSharp/Program.cs +++ b/Bot_Discord_CSharp/Program.cs @@ -1,4 +1,7 @@ -using System; +using Cqrs.Hosts; +using Microsoft.AspNetCore; +using Microsoft.AspNetCore.Hosting; +using System; namespace Bot_Discord_CSharp { @@ -6,8 +9,18 @@ namespace Bot_Discord_CSharp { static void Main(string[] args) { + var host = CreateWebHostBuilder(args). + UseKestrel(). + UseUrls("http://0.0.0.0:" + Environment.GetEnvironmentVariable("$PORT")). + Build(); + + host.Run(); + Bot bot = new Bot(); bot.RunAsync().GetAwaiter().GetResult(); } + public static IWebHostBuilder CreateWebHostBuilder(string[] args) => + WebHost.CreateDefaultBuilder(args) + .UseStartup(); } }