Iis 如何将我的Web API应用程序设置为在网络上可用?

Iis 如何将我的Web API应用程序设置为在网络上可用?,iis,azure,asp.net-web-api,iis-express,applicationhost,Iis,Azure,Asp.net Web Api,Iis Express,Applicationhost,我可以从浏览器或其他应用程序(如Windows窗体应用程序)连接到我的Web API应用程序,方法是: http://localhost:28642/api/inventoryitems/GetAll …但是如何使本地主机对其他人可用(在同一网络上),以便他们可以进行相同的REST调用 这仅仅是他们连接到我的机器的问题,就像这样: http://platypus:28642/api/inventoryitems/GetAll …如果是这样,我必须做些什么才能使其可访问(如果有的话) 无论如何

我可以从浏览器或其他应用程序(如Windows窗体应用程序)连接到我的Web API应用程序,方法是:

http://localhost:28642/api/inventoryitems/GetAll
…但是如何使本地主机对其他人可用(在同一网络上),以便他们可以进行相同的REST调用

这仅仅是他们连接到我的机器的问题,就像这样:

http://platypus:28642/api/inventoryitems/GetAll
…如果是这样,我必须做些什么才能使其可访问(如果有的话)

无论如何,我真的不想一直在我的机器上运行我的Web API应用程序,所以:我如何设置它,使它能够全天候运行,而不必启动/照看它

Azure网站对此是否有效

更新 可能是(根据我读到的内容)从以下位置更改applicationhost.config:

<site name="HandheldServer" id="20">
    <application path="/" applicationPool="Clr4IntegratedAppPool">
        <virtualDirectory path="/"  physicalPath="C:\HandheldServer\HandheldServer" />
    </application>
    <bindings>
      <binding protocol="http" bindingInformation="*:28642:localhost" />
      <binding protocol="http" bindingInformation="*:28642:platypus" />
      <binding protocol="https" bindingInformation="*:44300:localhost" />
    </bindings>
</site>

……为此:

<site name="HandheldServer" id="20">
    <application path="/" applicationPool="Clr4IntegratedAppPool">
        <virtualDirectory path="/" physicalPath="C:\HandheldServer\HandheldServer" />
    </application>
    <bindings>
      <binding protocol="http" bindingInformation="*:28642:localhost" />
      <binding protocol="http" bindingInformation="*:28642:platypus" />
      <binding protocol="http" bindingInformation="*:28642:" />
      <binding protocol="http" bindingInformation=":28642:" />
      <binding protocol="https" bindingInformation="*:44300:localhost" />
    </bindings>
</site>

…将使其可用(但是,我必须运行它,还是IISExpress会在后台启动它?)

据推测,第一个条目可能已经使其可用。我不知道是否需要带前缀的*,因此我有一个条目,有带前缀的和没有带前缀的。

您可以选择:

  • 购买Rasperberry Pi,以使独立服务器/服务代替您的机器运行
  • 购买副总裁
  • 打开路由器上的防火墙端口
  • 使用智能手机(是的,这是可能的)
  • 更改主机文件(windows、linux、mac)

没有奇迹;)

我喜欢吃辣莓馅饼(但我更喜欢黑莓和鹅莓)。我不知道鹅莓:)看起来不错,如果你去过密苏里州的汉尼拔……那是我见过的唯一一个地方,如果有机会,你一定要尝尝!马克·吐温年轻时有句话是有原因的,“我不会为了馅饼而那样做!”