Created
January 30, 2020 04:28
-
-
Save curiousape-ph/b7f091fc991bdc737702434cde3358e4 to your computer and use it in GitHub Desktop.
Dotnet Core 3.1.1 CloudRun Program.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Program | |
| { | |
| public static void Main(string[] args) | |
| { | |
| CreateHostBuilder(args).Build().Run(); | |
| } | |
| public static IHostBuilder CreateHostBuilder(string[] args) | |
| { | |
| string port = Environment.GetEnvironmentVariable("PORT") ?? "8080"; | |
| string url = String.Concat("http://0.0.0.0:", port); | |
| return Host.CreateDefaultBuilder(args) | |
| .ConfigureWebHostDefaults(webBuilder => | |
| { | |
| webBuilder.UseStartup<Startup>().UseUrls(url); | |
| }); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment