o9s
is a microblog
home archives search feed blogroll


Host A Vue.js App On Amazon S3

Install Node

Visit https://nodejs.org/en/download/ and install Node.

Alternatively, if you are on macOS and have Homebrew, use the following command.

brew install node

Install vue-cli and create a new app

npm install -g vue-cli
vue init webpack [your_project_name]

Run your app locally

cd [your_project_name]
npm run start

Open your browser and navigate to localhost:5000.

Create an AWS account

Visit https://aws.amazon.com and create an account.

Navigate to Amazon S3 and create a bucket

Choose a bucket name

Navigate to Amazon S3 and create a bucket

The name must be unique and not just unique to your account, but unique across all buckets of all accounts.

Enable static website hosting

Navigate to your bucket’s properties and enable static website hosting. Note the endpoint, it’s your site’s URL.

Navigate to Amazon S3 and create a bucket

Build your Vue.js app

If you didn’t touch the scripts in package.json, the build command is probably the following.

npm run build

Upload your app

Upload the content of the dist/ directory to your bucket.

Posted on 2018-01-13   #vuejs     #javascript  






← Next post    ·    Previous post →