Skip to content

Instantly share code, notes, and snippets.

@uzbekdev1
Created October 6, 2025 10:37
Show Gist options
  • Save uzbekdev1/cd855b19ebce4137d580c730ba7078e2 to your computer and use it in GitHub Desktop.
Save uzbekdev1/cd855b19ebce4137d580c730ba7078e2 to your computer and use it in GitHub Desktop.
cilent ocrs
{
"ClientUrls": [
"http://localhost:2755",
"https://mb.ipakyulibank.uz:2744",
"https://mb.ipakyulibank.uz:2755"
],
}
public class AppSettings
{
public string[] ClientUrls { get; set; }
}
public class Program
{
public static void Main(string[] args)
{
var builder = WebApplication.CreateBuilder(args);
var appSettings = new AppSettings();
builder.Configuration.Bind(appSettings);
builder.Services.AddSingleton(appSettings);
var app = builder.Build();
app.UseCors(builder => builder.WithOrigins(appSettings.ClientUrls).AllowAnyHeader().AllowAnyMethod().AllowCredentials());
app.Run();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment