这是我在typescript中用于控制器函数的代码,所以它给出了上面的错误,即使处理程序函数存在于控制器文件中
export const test  =  {
options:{
    handler: (request, reply) => {
      return reply.response({a: "Hello World"}).code(200);
    },
    plugins: {
      "hapi-swagger": {
        responses: {'200': {'description': 'OK'}
        }
      }
    },
    tags: undefined
}
}
};发布于 2019-05-13 03:04:35
缺少requires for /test路由处理程序。
 { method: 'GET', path: '/test', config: MyRequireStatmentIsMissing.test },添加缺少的要求
const MyRequireStatmentIsMissing = require('./controller/test');这将清除该错误。
https://stackoverflow.com/questions/53904004
复制相似问题