'How to call swagger in Net6 use reactjs template in fe? They auto generate 2 port. One can call api, one use to display website

In dotnet6 with reactjs it auto proxy port ex: port 44372 at start page and after reactjs load the finish in port 44437 => it auto redirect to 44437. If i use port 44372 i can access to swagger by type /swagger/index.html but now the website run in port 44437 ( i still can use https://localhost:44372/swagger/index.html to access the swagger) but in port 44372 i can not. How i can use the same port 44372 to access both main page and swagger?

In dotnet 5. They do not use proxy and 2 port. but .net6 they do that. I search but not sure what is the correct keywork.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source