added allow urls to use

This commit is contained in:
Bangara Raju Kottedi 2024-04-30 13:51:22 +05:30
parent c7b1f28c92
commit efb1f344e0
2 changed files with 11 additions and 1 deletions

View File

@ -17,6 +17,15 @@ Log.Logger = new LoggerConfiguration()
var builder = WebApplication.CreateBuilder(args);
var urls = builder.Configuration.GetRequiredSection("Urls");
if (!string.IsNullOrEmpty(urls.Value))
{
var allowedUrlsToUse = urls.Value.Split(',');
builder.WebHost.UseUrls(allowedUrlsToUse);
}
builder.Host.UseSerilog();
// Add services to the container.

View File

@ -10,5 +10,6 @@
"Microsoft.AspNetCore": "Warning"
}
},
"XApiKey": "c6eAXYcNT873TT7BfMgQyS4ii7hxa53TLEUN7pAGaaU="
"XApiKey": "c6eAXYcNT873TT7BfMgQyS4ii7hxa53TLEUN7pAGaaU=",
"Urls": "http://localhost:5000"
}