Skip to content

Instantly share code, notes, and snippets.

@deeja
Created March 22, 2021 18:20
Show Gist options
  • Save deeja/eb614df7e4f9ab214081217dbb956ddd to your computer and use it in GitHub Desktop.
Save deeja/eb614df7e4f9ab214081217dbb956ddd to your computer and use it in GitHub Desktop.
Kestrel self hosting .net core 3.1
{
"Kestrel": {
"Endpoints": {
"Http": {
"Url": "http://localhost:5015"
},
"Https": {
"Url": "https://localhost:5016",
"Certificate": {
"Path": "C:\\development\\localhost.p12",
"Password": "password here"
}
}
}
}
}
private static IHostBuilder CreateHostBuilder(string[] args)
{
return Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
webBuilder.UseKestrel((context, options) =>
{
options.Configure(context.Configuration.GetSection("Kestrel"));
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment