Created
October 6, 2025 10:37
-
-
Save uzbekdev1/cd855b19ebce4137d580c730ba7078e2 to your computer and use it in GitHub Desktop.
cilent ocrs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "ClientUrls": [ | |
| "http://localhost:2755", | |
| "https://mb.ipakyulibank.uz:2744", | |
| "https://mb.ipakyulibank.uz:2755" | |
| ], | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class AppSettings | |
| { | |
| public string[] ClientUrls { get; set; } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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