【发布时间】:2017-01-10 22:27:56
【问题描述】:
尝试从 nodeJS vagrant virtual box 运行以下 curl 命令。
本地主机的 IP 地址 - 10.29.12.152
而且,我还使用 expressJS 开发了列表 API 端点。
如果我在 Web 浏览器中运行上述 API 端点,它将从本地环境中获取结果。
[
{
_index: "zeta-spot-cms",
_type: "documents",
_id: "AVmCw40nHO6bFVnpAj-5",
_score: 1,
_source: {}
}
]
尝试将此 API 用作 vagrant 虚拟框中的 curl 命令。我收到以下错误。
<div id="titles">
<h1>ERROR</h1>
<h2>The requested URL could not be retrieved</h2>
</div>
<hr>
<div id="content">
<p>The following error was encountered while trying to retrieve the URL: <a href="http://10.29.12.152:3002/api/v1/suggest/zeta-spot-cms/documents?">http://10.29.12.152:3002/api/v1/suggest/zeta-spot-cms/documents?</a></p>
<blockquote id="error">
<p><b>Connection to 10.29.12.152 failed.</b></p>
</blockquote>
<p id="sysmsg">The system returned: <i>(113) No route to host</i></p>
<p>The remote host or network may be down. Please try the request again.</p>
您能否建议我,如何在 vagrant 虚拟框中提高 curl 命令以获取 localhost 的结果。
提前致谢!
【问题讨论】: