$ amplify add auth Using service: Cognito, provided by: awscloudformation
The current configured provider is Amazon Cognito.
Do you want to use the default authentication and security configuration? Default configuration Warning: you will not be able to edit these selections. How do you want users to be able to sign in? Email Do you want to configure advanced settings? No, I am done. Successfully added resource amplifytestab53a8bb locally ...
npx amplify-app@latest npm i @aws-amplify/core @aws-amplify/datastore --save-dev
Amplify API を追加します。
1 2 3 4 5 6 7 8 9 10 11 12 13
$ amplify add api
? Please select from one of the below mentioned services: GraphQL ? Provide API name: amplifyTest ? Choose the default authorization type for the API Amazon Cognito User Pool Use a Cognito user pool configured as a part of this project. ? Do you want to configure advanced settings for the GraphQL API No, I am done. ? Do you have an annotated GraphQL schema? No ? Do you want a guided schema creation? Yes ? What best describes your project: One-to-many relationship (e.g., “Blogs” with “Posts” and “Comments”) ? Do you want to edit the schema now? Yes Please edit the file in your editor: /home/vagrant/amplify-test/amplify/backend/api/amplifyTest/schema.graphql ? Press enter to continue
[WARN] 27:23.221 DataStore - Sync error subscription failed Connection failed: {"errors":[{"message":"Validation error of type FieldUndefined: Field '_version' in type 'Status' is undefined @ 'onCreateStatus/_version'"},{"message":"Validation error of type FieldUndefined: Field '_lastChangedAt' in type 'Status' is undefined @ 'onCreateStatus/_lastChangedAt'"},{"message":"Validation error of type FieldUndefined: Field '_deleted' in type 'Status' is undefined @ 'onCreateStatus/_deleted'"}]}
作り方を変えてみる
今まで作ったものを捨てて作り方を変えてみます。
まず amplify delete で CloudFormation スタックを削除します。
プロジェクトを作成します。
1 2 3 4
ng new sakai-amplify-test --style=scss --routing cd sakai-amplify-test npx amplify-app@latest npm i @aws-amplify/core @aws-amplify/datastore --save-dev
$ amplify push ✔ Successfully pulled backend environment dev from the cloud.
Current Environment: dev
| Category | Resource name | Operation | Provider plugin | | -------- | ------------------------ | --------- | ----------------- | | Api | amplifyDatasource | Create | awscloudformation | | Auth | sakaiamplifytestcce6b8e1 | Create | awscloudformation | ? Are you sure you want to continue? Yes
GraphQL schema compiled successfully.
Edit your schema at /home/vagrant/sakai-amplify-test/amplify/backend/api/amplifyDatasource/schema.graphql or place .graphql files in a directory at /home/vagrant/sakai-amplify-test/amplify/backend/api/amplifyDatasource/schema ? Do you want to generate code for your newly created GraphQL API Yes ? Choose the code generation language target angular ? Enter the file name pattern of graphql queries, mutations and subscriptions src/graphql/**/*.graphql ? Do you want to generate/update all possible GraphQL operations - queries, mutations and subscriptions Yes ? Enter maximum statement depth [increase from default if your schema is deeply nested] 2 ? Enter the file name for the generated code src/app/service/api.service.ts
# Example rule allowing access from your local networks. # Adapt to list your (internal) IP networks from where browsing # should be allowed cache_peer proxy.zak.sobal.co.jp parent 3128 0 no-query no-netdb-exchange login=ユーザー名:パスワード
1 2
acl SSL_ports port 22 acl Safe_ports port 22
1 2 3 4 5 6 7 8 9 10 11 12
# # Recommended minimum Access Permission configuration: # acl TRACE method TRACE acl GET method GET acl POST method POST acl PUT method PUT acl OPTIONS method OPTIONS acl DELETE method DELETE
acl SSL method CONNECT never_direct allow all
1
dns_nameservers [DNS サーバー1] [DNS サーバー2] ...
Squid を再起動します。コントロールパネル→管理ツール→サービス→Squid for Windows を選択して「再起動」ボタンを押します。