A guide on how to connect AWS S3 to a React Frontend
Go to file
Namya LG 085b3b2567
Merge pull request #2 from Namyalg/master
Added comments, code clean up
2022-04-01 20:37:56 +05:30
public Initialize project using Create React App 2022-04-01 14:50:05 +05:30
src Added comments, code clean up 2022-04-01 20:37:18 +05:30
.gitignore App to upload images from frontend to AWS S3 2022-04-01 17:13:35 +05:30
package-lock.json App to upload images from frontend to AWS S3 2022-04-01 17:13:35 +05:30
package.json App to upload images from frontend to AWS S3 2022-04-01 17:13:35 +05:30
README.md Update README.md 2022-04-01 20:29:26 +05:30

Upload-to-S3-from-React

An easy to guide to setup an AWS S3 bucket and upload files to it from a React frontend

Steps to follow

  1. Create the AWS S3 bucket as mentioned here

  2. Clone this repository

  3. Run npm install

    The react-aws-s3 package, has been used to facilitate the file uploads to th S3 bucket

  4. Create a .env file at the root of the repository and add the details in the following format

    REACT_APP_BUCKET_NAME=your-bucket-name
    REACT_APP_REGION=us-west-2 (eg: add the location of your bucket)
    REACT_APP_ACCESS=got-from-the-security-credentials
    REACT_APP_SECRET=got-from-the-security-credentials
    
  5. Run npm start to start the server on PORT 3000

On uploading a file, it will get uploaded to the S3 bucket!