Fixed a deployment bug where we weren't listening on port properly. New way will force firewall exception dialog on Windows and work across board. Implemented user preferences and ability to update them.
This commit is contained in:
parent
3548a3811c
commit
bd5a1338c4
24 changed files with 987 additions and 5 deletions
|
@ -4,6 +4,7 @@ using API.Data;
|
|||
using API.Entities;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Server.Kestrel.Core;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
|
@ -17,6 +18,8 @@ namespace API
|
|||
{
|
||||
}
|
||||
|
||||
private static readonly int HttpPort = 5000; // TODO: Get from DB
|
||||
|
||||
public static async Task Main(string[] args)
|
||||
{
|
||||
var host = CreateHostBuilder(args).Build();
|
||||
|
@ -46,7 +49,26 @@ namespace API
|
|||
Host.CreateDefaultBuilder(args)
|
||||
.ConfigureWebHostDefaults(webBuilder =>
|
||||
{
|
||||
webBuilder.UseKestrel((builderContext, opts) =>
|
||||
{
|
||||
opts.ListenAnyIP(HttpPort);
|
||||
});
|
||||
webBuilder.UseStartup<Startup>();
|
||||
});
|
||||
|
||||
private static string BuildUrl(string scheme, string bindAddress, int port)
|
||||
{
|
||||
return $"{scheme}://{bindAddress}:{port}";
|
||||
}
|
||||
|
||||
private static void ConfigureKestrelForHttps(KestrelServerOptions options)
|
||||
{
|
||||
options.ListenAnyIP(HttpPort);
|
||||
// options.ListenAnyIP(HttpsPort, listenOptions =>
|
||||
// {
|
||||
// listenOptions.Protocols = HttpProtocols.Http1AndHttp2;
|
||||
// //listenOptions.UseHttps(pfxFilePath, pfxPassword);
|
||||
// });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue