【发布时间】:2021-05-03 20:20:57
【问题描述】:
我正在关注自动设置https://docs.amplify.aws/lib/restapi/getting-started/q/platform/js
我已经使用 Amplify UI 创建了数据模型并运行
amplify pull --appId XXXX --envName staging
我得到了
Successfully generated models. Generated models can be found in /dev/extension/vue-extension/src
Post-pull status:
Current Environment: staging
| Category | Resource name | Operation | Provider plugin |
| -------- | ------------- | --------- | ----------------- |
| Api | my_custom_name | No Change | awscloudformation |
但是当我运行这段代码时
import Amplify, { API } from 'aws-amplify';
import awsconfig from '@/aws-exports';
Amplify.configure(awsconfig);
API.get('my_custom_name', '/rankings').then(items => console.log(items)).catch(e=> console.log(e ));
我明白了
API my_custom_name 不存在
【问题讨论】:
-
我现在遇到了同样的错误。你有什么解决方法吗??
-
不,我放弃了。如果您找到解决方案,请告诉我
-
我刚刚从 amplify 中删除了 api 然后读取。它解决了我的问题。
标签: aws-amplify