使用腾讯云开发微信小程序。上次测试代码时,错误消息如下:
/data/release/node-weapp-demo/node_modules/koa-router/lib/layer.js:38
throw new Error(
^
Error: post `/trolley`: `middleware` must be a function, not `undefined`
at Layer.<anonymous> (/data/release/node-weapp-demo/node_modules/koa-router/lib/layer.js:38:13)
at Array.forEach (native)
at new Layer (/data/release/node-weapp-demo/node_modules/koa-router/lib/layer.js:35:14)
at Router.register (/data/release/node-weapp-demo/node_modules/koa-router/lib/router.js:552:15)
at Router.(anonymous function) [as post] (/data/release/node-weapp-demo/node_modules/koa-router/lib/router.js:202:10)
at Object.<anonymous> (/data/release/node-weapp-demo/routes/index.js:55:8)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/data/release/node-weapp-demo/app.js:15:16)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
我该怎么办?