Created
April 9, 2017 17:11
-
-
Save luuhq/d05732e1b7eb0c98660f5dc10c606c76 to your computer and use it in GitHub Desktop.
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
private static IWebHost CreateWebHost() | |
{ | |
var scheme = Environment.GetEnvironmentVariable("SCHEME"); | |
if (string.IsNullOrWhiteSpace(scheme)) | |
{ | |
scheme = "http"; | |
} | |
var port = Environment.GetEnvironmentVariable("PORT"); | |
if (string.IsNullOrWhiteSpace(port)) | |
{ | |
port = "5000"; | |
} | |
var host = new WebHostBuilder() | |
.UseKestrel() | |
.UseContentRoot(Directory.GetCurrentDirectory()) | |
.UseIISIntegration() | |
.UseStartup<Startup>() | |
.UseUrls($"{scheme}://0.0.0.0:{port}") | |
.Build(); | |
return host; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment