From 097e538165f47478cd3e981d059be5421028ff2c Mon Sep 17 00:00:00 2001 From: Piotr Kus Date: Tue, 28 Jan 2025 20:33:32 +0100 Subject: [PATCH] Change API to be able to work externaly --- FaKrosnoApi/Program.cs | 4 +++- FaKrosnoApi/appsettings.json | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/FaKrosnoApi/Program.cs b/FaKrosnoApi/Program.cs index 84bad12..971dd24 100644 --- a/FaKrosnoApi/Program.cs +++ b/FaKrosnoApi/Program.cs @@ -10,7 +10,7 @@ using FaKrosnoMappingProfile = FaKrosnoEfDataModel.MappingProfile; using SytelineSaAppMappingProfile = SytelineSaAppEfDataModel.MappingProfile; var builder = WebApplication.CreateBuilder(args); - +var configuration = builder.Configuration; // Add services to the container. builder.Services.AddDbContext(options => options.UseSqlServer(builder.Configuration.GetConnectionString("FaKrosnoConnection"))); @@ -56,6 +56,8 @@ builder.Services.AddScoped(); var app = builder.Build(); +app.Urls.Add(configuration.GetValue("Host:Urls")); + // Configure the HTTP request pipeline. //if (app.Environment.IsDevelopment()) //{ diff --git a/FaKrosnoApi/appsettings.json b/FaKrosnoApi/appsettings.json index 8fc4467..7604b68 100644 --- a/FaKrosnoApi/appsettings.json +++ b/FaKrosnoApi/appsettings.json @@ -14,5 +14,7 @@ "Issuer": "FaKrosnoApi", "Audience": "FaKrosnoClient" }, - "AllowedHosts": "*" + "Host": { + "Urls": "http://0.0.0.0:5000" + } }