93

GitHub - FenrisWulf/publish-react-app: Tool for publishing a react app publicly...

 6 years ago
source link: https://github.com/FenrisWulf/publish-react-app
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

publish-react-app

Tool for automatically publishing a react app to the internet via S3

Exampe usage

npm install -g create-react-app publish-react-app
create-react-app myapp
cd myapp/
npm run build
AWS_ACCESS_KEY_ID={Your AWS key ID here} AWS_SECRET_ACCESS_KEY={Your AWS secret here} publish-react-app
# Your website is now available: [your url will be here]

What it does

So you've created a React app. Now you want to get it off of localhost and put it on the real internet. But you don't want to think about how cloud hosting works. You just want to run a command. This tool does just that. Given a users AWS credentials, this tool will upload all of the contents generated by a project started by create-react-app and get a sharable link to the final product. Since S3 is free for the first year, and then cheap after that, it is an ideal way to share your React apps.

In short, this package will take the contents of your ./build folder and upload them to S3. The package will create bucket in your account. You will be given a randomly generated URL of where the S3 bucket is.

What are AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY?

If you do not have your own AWS_ACCESS_KEY_ID or AWS_SECRET_ACCESS_KEY here is how you can get one:

  1. Create an account by signing up to https://aws.amazon.com/
  2. Add a user by going to https://console.aws.amazon.com/iam/home?#/users$new?step=details
    • Select Programmatic access as Access Type
    • Hit the Next: Permissions button
    • Hit Create group
    • Make group name something like "Admin" and select AdministratorAccess as the policy name
    • Hit the Create policy button.
    • Hit the Next: Review button
    • Hit the Create user
  3. At the final screen, the Access key ID and Secret access key strings will be visible.

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK