【发布时间】:2013-09-13 15:46:48
【问题描述】:
我正在从这个页面运行server.coffee:https://github.com/xenph/foaas
从命令行,你可以:
curl http://localhost:5000/off/Name1/Name2
!@#$ off, Name1. - Name2
但我正在使用此页面中的代码:http://coffeescriptcookbook.com/chapters/networking/basic-http-client
http = require 'http'
http.get { host: 'http://localhost:5000/off/Name1/Name2' }, (res) ->
data = ''
res.on 'data', (chunk) ->
data += chunk.toString()
res.on 'end', () ->
console.log data
我得到的错误是:
events.js:72
throw er; // Unhandled 'error' event
^
Error: getaddrinfo ENOTFOUND
at errnoException (dns.js:37:11)
at Object.onanswer [as oncomplete] (dns.js:124:16)
这让我相信它没有找到网址。
我能做什么?
【问题讨论】:
标签: node.js http coffeescript