我正在使用打字稿和无服务器框架来构建 API。这是我的源代码: https ://github.com/liou-jia-hao/api/tree/add-ajv
我按照本教程构建自定义授权者: https ://www.serverless.com/framework/docs/providers/aws/events/apigateway#http-endpoints-with-custom-authorizers
但我得到这个错误:
PS D:\src\social-app-api> serverless deploy
Deploying social-app to stage dev (ap-northeast-1)
Compiling with Typescript...
Using local tsconfig.json - tsconfig.json
Typescript compiled.
× Stack social-app-dev failed to deploy (163s)
Environment: win32, node 14.18.2, framework 3.1.1, plugin 6.0.0, SDK 4.3.1
Credentials: Local, "default" profile
Docs: docs.serverless.com
Support: forum.serverless.com
Bugs: github.com/serverless/serverless/issues
Error:
Event references not configured authorizer 'authorizerFunc'
我在无服务器 repo 上发现了这个问题: https ://github.com/serverless/serverless/issues/8781 但是在阅读了这个问题之后,我刚刚看到 BryanCrotaz 说解决了。但我仍然不知道如何解决这个错误。