【发布时间】:2011-09-13 04:23:21
【问题描述】:
我正在使用CoffeeScript,请注意:
searchResults = (err, data)->
res.write 'hello'
console.log data
console.log 'here'
return
exports.search = (req, res) ->
res.writeHead 200, {'Content-Type': 'application/json'}
location = req.param 'location'
item = req.param 'item'
geoC = googlemaps.geocode 'someaddress', (err, data) ->
latLng = JSON.stringify data.results[0].geometry.location
myModule.search latLng, item, searchResults
return
return
searchResults 函数不知道res,那我如何将数据返回给浏览器呢?
【问题讨论】:
标签: node.js coffeescript express