Last active
November 19, 2019 20:08
-
-
Save ahmetkucukoglu/205e68aa15b2602eb2d5e776889e91f4 to your computer and use it in GitHub Desktop.
GCP Docker Image'ı Serverless Olarak Yayına Alma - 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
namespace CloudRunSampleAPI | |
{ | |
using Microsoft.AspNetCore; | |
using Microsoft.AspNetCore.Hosting; | |
using System; | |
public class Program | |
{ | |
public static void Main(string[] args) | |
{ | |
string port = Environment.GetEnvironmentVariable("PORT") ?? "8080"; | |
string url = string.Concat("http://0.0.0.0:", port); | |
CreateWebHostBuilder(args, url).Build().Run(); | |
} | |
public static IWebHostBuilder CreateWebHostBuilder(string[] args, string url) => | |
WebHost.CreateDefaultBuilder(args) | |
.UseStartup<Startup>() | |
.UseUrls(url); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment