How To Host a Vue.js Static Website With GCP Cloud Storage

A step by step guide with an example project

Bhargav Bachina
Bachina Labs

--

Photo by yann maignan on Unsplash

There are a number of ways you can build a website with Vue.js such as Java with Vue, NodeJS with Vue, NGINX serving Vue, etc. For the single-page applications, all you need to do is to load the initial index.html. Once you load the index.html the Vue library kicks in and do the rest of the job like loading component, calling API calls, etc. What if there are no backend calls and you want to build a static website with Vue.js?

GCP Cloud Storage is a globally unified, scalable, and highly durable object storage for developers and enterprises. We can configure a Cloud Storage bucket to host a static website for a domain you own. The index.html from the Vue UI can be placed in the bucket along with all the related HTML, CSS, and JavaScript files.

  • Why This Approach
  • Example Project
  • Prerequisites
  • Create a Bucket With Public Access
  • Build the Vue project With Relative Path
  • Upload and Test
  • Next Steps
  • Summary
  • Conclusion

Why This Approach

--

--