MBP(はてな)

MacBook Pro,iPhone Xs,React

AWS AmplifyでNext.js

Next.jsはReactをベースにしたフロントエンドフレームワーク

$ npx create-next-app amplify-nextjs --use-npm --example "https://github.com/vercel/next-learn-starter/tree/master/learn-starter"
$ cd amplify-nextjs
$ npm run dev

GitHubリポジトリを作成して
$ git remote add origin git@github.com:hiroyuki12/amplify-nextjs.git
git branch -M main
git push -u origin main

AWSのユーザーを追加。参考
リポジトリの作成でエラー。An error occurred (UnrecognizedClientException) when calling the CreateRepository operation: The security token included in the request is invalid.
Code Commit (AWS上で使えるGitHubのようなもの)

region us-east-2
AWSコンソール(region=us-east-2)を開き、
AWS amplifyを選択
New app - Host web appを選択して、
GitHubを選択、
作成したリポジトリを選択して、
Create new roleボタンでロールを作成して、
デプロイ

デプロイの進捗は、AWSコンソールで確認

https://main.d2zio6fifmbrul.amplifyapp.com

GitHub - hiroyuki12/amplify-nextjs

Next.js、Amplifyで開発環境構築する話 - Qiita