如何解决AWS Amplify 中缺少 API 和存储功能
我使用 React 成功将我的代码部署到 AWS Amplify,并且可以通过为环境提供的 URL 访问应用程序。但是,当我发起 API 调用时,什么也没有发生。
ERROR Uncaught Exception {"errorType":"TypeError","errorMessage":"Cannot read property 'link_token' of undefined","stack":["TypeError: Cannot read property 'link_token' of undefined"," at /var/task/app.js:44:46"," at Immediate.<anonymous> (/var/task/node_modules/plaid/lib/wrapPromise.js:29:9)"," at processImmediate (internal/timers.js:461:21)"]}
我查看了 AWS 中的配置,可以看到分别在 Lambda、Dynamo 和 API Gateway 中创建的函数、存储和 API。但是,当我在 Amplify 中打开我的应用程序时,我没有看到创建的存储或 API。函数已创建。是否有可能导致创建函数但不创建存储和 API?后端 JSON 配置(如下)包含我期望的所有五个。
放大 backend-config.json
{
"function": {
"linktokenfunction": {
"build": true,"providerPlugin": "awscloudformation","service": "Lambda"
},"onsuccessfunction": {
"build": true,"service": "Lambda","dependsOn": [
{
"category": "storage","resourceName": "tutorialdb","attributes": [
"Name","Arn"
]
}
]
}
},"api": {
"linktokenapi": {
"service": "API Gateway","dependsOn": [
{
"category": "function","resourceName": "linktokenfunction","Arn"
]
}
]
},"onsuccessapi": {
"service": "API Gateway","resourceName": "onsuccessfunction","storage": {
"tutorialdb": {
"service": "DynamoDB","providerPlugin": "awscloudformation"
}
}
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。