Change API to be able to work externaly

This commit is contained in:
2025-01-28 20:33:32 +01:00
parent a95eed2041
commit 097e538165
2 changed files with 6 additions and 2 deletions

View File

@@ -10,7 +10,7 @@ using FaKrosnoMappingProfile = FaKrosnoEfDataModel.MappingProfile;
using SytelineSaAppMappingProfile = SytelineSaAppEfDataModel.MappingProfile; using SytelineSaAppMappingProfile = SytelineSaAppEfDataModel.MappingProfile;
var builder = WebApplication.CreateBuilder(args); var builder = WebApplication.CreateBuilder(args);
var configuration = builder.Configuration;
// Add services to the container. // Add services to the container.
builder.Services.AddDbContext<FaKrosnoDbContext>(options => builder.Services.AddDbContext<FaKrosnoDbContext>(options =>
options.UseSqlServer(builder.Configuration.GetConnectionString("FaKrosnoConnection"))); options.UseSqlServer(builder.Configuration.GetConnectionString("FaKrosnoConnection")));
@@ -56,6 +56,8 @@ builder.Services.AddScoped<ICustomerOrderService, CustomerOrderService>();
var app = builder.Build(); var app = builder.Build();
app.Urls.Add(configuration.GetValue<string>("Host:Urls"));
// Configure the HTTP request pipeline. // Configure the HTTP request pipeline.
//if (app.Environment.IsDevelopment()) //if (app.Environment.IsDevelopment())
//{ //{

View File

@@ -14,5 +14,7 @@
"Issuer": "FaKrosnoApi", "Issuer": "FaKrosnoApi",
"Audience": "FaKrosnoClient" "Audience": "FaKrosnoClient"
}, },
"AllowedHosts": "*" "Host": {
"Urls": "http://0.0.0.0:5000"
}
} }