question

saanvi-7629 avatar image
0 Votes"
saanvi-7629 asked YihuiSun-MSFT answered

can we route all api call to ip adress instead of localhost

HI Team,

can we route all api call to ip adress instead of localhost if yes please share supported code

below are example

https://IP :8881/api/v1/devices

https://localhost:8881/api/v1/devices

dotnet-aspnet-mvc
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I'm not sure why you would want to do this. Open the hosts file (C:\Windows\System32\drivers\etc) using a text editor. Then make the change. The hosts file has instructions.

0 Votes 0 ·

1 Answer

YihuiSun-MSFT avatar image
0 Votes"
YihuiSun-MSFT answered

Hi @saanvi-7629,

Do you want to open the website by IP address?

➤If this is the case, you can deploy the project to IIS first, and then access the website through the IP address.
86143-pic.png


Here are some links that can help you.

Publish to IIS
How to configure ASP.NET MVC web project to be accessible from another PC in the company's same network?


If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Best Regards,
YihuiSun


pic.png (9.9 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.