将 aws-exports.js 移动到另一个 Angular 项目?
Moving aws-exports.js to another Angular Project?
如果我们想在两个不同的 Angular 应用程序中使用同一个池,我们可以简单地将 aws-exports
复制到另一个应用程序并在 main.ts
中配置 Auth 类别,还是我们有到 运行 amplify init
项目。我知道我们需要执行此处记录的脚手架步骤:
https://medium.com/@ole.ersoy/getting-angular-ready-for-aws-amplify-fc33f07f14a2
我已经试过了,但没有用,所以看来我们可能必须 运行 amplify init
但我想再确认一下是否有人试过这个?
这最终是对配置过程的更改。现在必须像这样配置 Auth:
import Amplify from '@aws-amplify/core'
import { Auth } from '@aws-amplify/auth'
import awsconfig from './aws-exports'
Amplify.configure(awsconfig)
Auth.configure(awsconfig)
而在刚刚做之前:
Amplify.configure(awsconfig)
够了。
如果我们想在两个不同的 Angular 应用程序中使用同一个池,我们可以简单地将 aws-exports
复制到另一个应用程序并在 main.ts
中配置 Auth 类别,还是我们有到 运行 amplify init
项目。我知道我们需要执行此处记录的脚手架步骤:
https://medium.com/@ole.ersoy/getting-angular-ready-for-aws-amplify-fc33f07f14a2
我已经试过了,但没有用,所以看来我们可能必须 运行 amplify init
但我想再确认一下是否有人试过这个?
这最终是对配置过程的更改。现在必须像这样配置 Auth:
import Amplify from '@aws-amplify/core'
import { Auth } from '@aws-amplify/auth'
import awsconfig from './aws-exports'
Amplify.configure(awsconfig)
Auth.configure(awsconfig)
而在刚刚做之前:
Amplify.configure(awsconfig)
够了。