【发布时间】:2018-12-04 05:02:01
【问题描述】:
我正在使用来自here 的npm json-server。它曾经非常适合我的需求:在我的 PC 上运行服务器并对本地 IP (192.168.1.XX) 执行 GET 请求。我重新安装了它,现在我只能向 localhost 或 127.0.0.1 发出请求。不能再向本地 IP (cmd ipconfig) 发出请求。我收到此错误:
正如@fvu 提到的here
这意味着服务器软件被配置为仅在 localhost 接口上侦听。这是一个配置项,为了避免暴露潜在的不安全服务器,许多服务器程序预先配置为仅在 localhost 上侦听。
那么有没有办法通过本地 IP 访问这个服务器,只要 json-server 没有一些额外的参数来启用/禁用它?
【问题讨论】:
-
这个解决方案对我不起作用。 this issue for me has been solved with this solution
标签: server ip json-server