Skip to content

epomatti/aws-amplify-axios-vite

Repository files navigation

AWS Amplify + Vite and Axios

Localhost

cp example.env .env

yarn install
yarn dev

AWS

To use GitHub Apps, first make sure you've granted permissions to the specific region you're using. Example:

https://github.com/apps/aws-amplify-us-east-2

The token permissions required are defined as follows:

Select scopes section, select admin:repo_hook

You can check the documentation for additional information.

You can use AWS CloudFormation, the Amplify CLI, and the SDKs to deploy a new Amplify app that uses the GitHub App for repo access. This process requires that you first install the Amplify GitHub App in your GitHub account. Next, you will need to generate a personal access token in your GitHub account. Lastly, deploy the app and specify the personal access token.

Console

You can easily create a Hosting using the web console.

Terraform

Copy the template and add the required variables:

cp terraform/config/dev.auto.tfvars terraform/

Create the app:

terraform init
terraform -chdir="terraform" apply -auto-approve

CLI

If you're using GitHub App, don't forget to give permissions

Using GitHub App tokens should be preferred.

token=<TOKEN>

aws amplify create-app \
  --name myviteapp \
  --region us-east-2
  --repository "https://github.com/epomatti/aws-amplify-axios-vite" \
  --enable-branch-auto-build \
  --access-token $token

aws amplify create-branch \
  --app-id <appid> \
  --branch-name main \
  --stage "PRODUCTION" \
  --environment-variables '{ "VITE_API_BASE_URL": "https://dummyjson.com" }'

About

Vite app deployment on AWS Amplify

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published