To go through this guide, you will need:
- An empty Platform.sh project (you can click here to start your free trial)
- Your SSH key loaded in your SSH agent and configured in the Platform.sh dashboard
- The Platform.sh CLI installed.
- The Vue CLI installed.
Create a new Vue.js project with Vue CLI (ignore this step if you want to deploy an existing Vue.js application on Platform.sh):
vue create vuejs-platformsh cd vuejs-platformsh
platform Git remote:
platform project:set-remote <project id>
Add the Platform.sh Vue plugin:
vue add platformsh
2. Deploy your application to Platform.sh
Commit and push your code to deploy your application:
git add --all git commit -m "Vue.js on Platform.sh." git push platform master
3. Test your application on Platform.sh
This opens a browser tab with your Vue.js application running.
4. Fetch Platform.sh environment variables
The plugin will automatically extract the Platform.sh environment variables.
To fetch those, you simply need to import the following package:
import platformshVar from 'platformsh_variables'
Using the Vue CLI, it’s very easy to setup and deploy a new or an existing Vue.js application on Platform.sh.