Last post May 24, 2018 12:54 PM by meganc53
May 23, 2018 06:53 PM|meganc53|LINK
I've setup REST web services which is working when using
https://servername:portNumber/api/Contacts. How do I configure it so consuming applications don't have to enter the portNumber? What do I have to do?
Any help or guidance is greatly appreciated.
May 23, 2018 07:31 PM|PatriceSc|LINK
You entered a port number because you already have another https site on the same server ? (or could it be you are still using IIS Express ?)
A common approach is to create a "mysitename" DNS name pointing to the same server (see with your network admin). You can then configure a site with "mysitename" as a host header name.
This way https://servername/ goes to a site on your server and
https://mysitename/ goes to another site on the same server (both having the same IP and the same port number).
May 24, 2018 09:25 AM|Brando ZWZ|LINK
As far as I know, if you directly access the url without using the port number, it means you will access the sever's 80 port.
On a Web server or Hypertext Transfer Protocol daemon, port 80 is the port that the server "listens to" or expects to receive from a Web client, assuming that the default was taken when the server was configured or set up.
So if you want access the web application without using the port number, I suggest you publish your web api application to the server's IIS web application as 80 port.
Since the IIS contains the default web application which has already used 80 port.
I suggest you could directly publish your web application to the default web application.
When we access the url:
May 24, 2018 12:54 PM|meganc53|LINK
Thank you PatriceSc and Brando ZWZ for your replies. Now I understand.
Yes, there was already existing site on the server. I followed Brando's suggestion and made the web api part of the IIS default web site and it works!