Aws lambda函数与节点返回“回调不是函数”

时间:2017-01-31 19:36:33

标签: javascript node.js amazon-web-services callback

我的一个朋友有这个问题,我们使用lite-server托管api,并在浏览器上访问api,它说回调不是一个函数。

select
    row_id = row_number() over (
      order by rrno.rrdate
        , rrno.pono
        , tbdet.meidhex
        , att.Date_cleared)
  , att_po = rrno.pono
  , Received_Date = rrno.rrdate
  , Model=case
      when (m.modeldesc = 'mixed')
        then tbdet.basemodel
      else m.modelbase
      end
  , imei=case
      when len(tbdet.meidhex) >= 15
        then left(tbdet.meidhex, 14)
      else tbdet.meidhex
      end 
  , [Future_imei] = Future.imei
  , Future.[Error Code]
  , Date_cleared=case
      when (Future.[Error Code] = '1')
        then Future.LocalTime
      else att.Date_cleared
      end 
  , [Result]=case
      when (Future.[Error Code] = '1')
        then 'pass'
      else att.Result
      end 
from wms_us.wms_us.transferboxdoc as tbdoc
  inner join wms_us.wms_us.transferboxdet as tbdet
    on tbdoc.transferboxdocid = tbdet.transferboxdocid
  inner join wms_us.wms_us.rrno as rrno
    on tbdet.rrnoid = rrno.rrnoid
  inner join wms_us.wms_us.model as m
    on tbdoc.modelid = m.modelid
  left outer join Futerdial.dbo.Futuredial_Validation as Future
      on Future.imei = left(tbdet.meidhex, 14)
  left outer join drscsqlqadb01.att_view2.dbo.attview2 as att
      on att.imei = left(tbdet.meidhex, 14)
  where (rrno.rrdate > '2016-12-01')

网址为:

http://localhost:3000/getBooks

1 个答案:

答案 0 :(得分:2)

此问题可能是由调用getBooks的代码引起的。

API调用完成后,您尝试调用作为参数callback传入的函数,但正如错误消息所示,您要调用的内容不是函数 。要解决此问题,请确保调用代码实际上将函数作为回调传递。