Hotfix for heroku deployment

This commit is contained in:
Álvaro Gómez Cuenca 2020-12-08 12:31:24 +01:00
commit a9c36ffe71
2 changed files with 17 additions and 1 deletions

View file

@ -6,10 +6,13 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Cqrs" Version="4.2.1729.923" />
<PackageReference Include="DSharpPlus" Version="4.0.0-nightly-00760" /> <PackageReference Include="DSharpPlus" Version="4.0.0-nightly-00760" />
<PackageReference Include="DSharpPlus.CommandsNext" Version="4.0.0-nightly-00760" /> <PackageReference Include="DSharpPlus.CommandsNext" Version="4.0.0-nightly-00760" />
<PackageReference Include="DSharpPlus.Interactivity" Version="4.0.0-nightly-00760" /> <PackageReference Include="DSharpPlus.Interactivity" Version="4.0.0-nightly-00760" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.28" /> <PackageReference Include="HtmlAgilityPack" Version="1.11.28" />
<PackageReference Include="Microsoft.AspNetCore" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions" Version="2.2.0" />
</ItemGroup> </ItemGroup>
<ProjectExtensions><VisualStudio><UserProperties config_1json__JsonSchema="" /></VisualStudio></ProjectExtensions> <ProjectExtensions><VisualStudio><UserProperties config_1json__JsonSchema="" /></VisualStudio></ProjectExtensions>

View file

@ -1,4 +1,7 @@
using System; using Cqrs.Hosts;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using System;
namespace Bot_Discord_CSharp namespace Bot_Discord_CSharp
{ {
@ -6,8 +9,18 @@ namespace Bot_Discord_CSharp
{ {
static void Main(string[] args) 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 bot = new Bot();
bot.RunAsync().GetAwaiter().GetResult(); bot.RunAsync().GetAwaiter().GetResult();
} }
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<StartUp>();
} }
} }