How To Host A Create-React-App Project On AWS Amplify
This tutorial will go through the steps of hosting a create-react-app project on AWS Amplify.
Prerequisites:
- An AWS account
- A GitHub Account
- A create-react-app project
- Node.js and npm installed on your machine
Commit the create-react-app project into a repository. We will use this repository later on AWS.
Steps:
- Go to the AWS Amplify console and sign in with your AWS credentials.
- Click the "Connect app" button in the top right corner of the dashboard. Select your Git provider (e.g. GitHub, Bitbucket, GitLab) and follow the instructions to connect your account and repository.
- Select the branch you want to deploy and configure the build settings:
- Framework: Choose "React" from the dropdown menu.
- Build command: npm run build
- Output directory: build
- Environment variables (optional): If your project requires any environment variables (e.g. API keys), you can set them here.
- Click the "Save and deploy" button to start the deployment process.
- Once the deployment is complete, click the "Domain" button in the top right corner of the dashboard to set up a custom domain (optional).
- Follow the instructions to configure your DNS settings and point your domain to the Amplify hosting URL.
That's it! Your create-react-app project should now be hosted on AWS Amplify. You can make updates to your project and push them to your Git repository to automatically trigger a new build and deployment.