Check out example codes for ".net core change localhost port". It will help you in understanding the concepts better.

Code Example 1

{
  "iisSettings": {
    "iisExpress": {
      "applicationUrl": "http://localhost:12345",
      "sslPort": 98765 <== Change_This
    }
  },

Learn ReactJs, React Native from akashmittal.com