Open4

Amplify-React-Graphql その1

marchanmarchan

https://aws.amazon.com/jp/getting-started/hands-on/build-react-app-amplify-graphql/module-one/?e=gs2020&p=build-a-react-app-intro

$ git clone https://github.com/***/Amplify-React-Graphql.git

Cannot create a project named "Amplify-React-Graphql" because of npm naming restrictions:

  • name can no longer contain capital letters
$ mv Amplify-React-Graphql amplify-react-graphql
$ ls

amplify-react-graphql

cd amplify-react-graphql/
$ npx create-react-app amplifyapp

Creating a new React app in /home/ec2-user/environment/amplify-react-graphql/amplifyapp.

8 vulnerabilities (2 moderate, 6 high)

To address all issues (including breaking changes), run:
npm audit fix --force

Compiled successfully!

$ npm audit

※注

marchanmarchan
$ cd ..
$ git init

Reinitialized existing Git repository in /home/ec2-user/environment/amplify-react-graphql/.git/

$ cd amplifyapp
$ git branch -m main
$ git remote add origin https://github.com/***/amplify-react-graphql.git
$ git status

On branch main
No commits yet
Untracked files:
(use "git add <file>..." to include in what will be committed)
.gitignore
README.md
package-lock.json
package.json
public/
src/

$ git add .
$ git commit -m "Initial Commit"
$ git status
$ git push -u origin main
Username for 'https://github.com/**/amplify-react-graphql.git': ******
Password for 'https://***@github.com/**/amplify-react-graphql.git': ****
  • [new branch] main -> main
    branch 'main' set up to track 'origin/main'.
$ git status

On branch main
Your branch is up to date with 'origin/main'.
nothing to commit, working tree clean

$ git config --global init.defaultBranch main
marchanmarchan

コードの変更を自動的にデプロイする

git add .
git commit -m “changes for v2”
git push origin main
npm start