[Vuejs]-Cloud foundry VCAP_SERVICES in VueJS Appliction

3👍

You cannot look at VCAP_SERVICES in a client’s browser, which is where your Vue.js app is running. This is because VCAP_SERVICES is an environment variable set on the server-side where your application is being hosted.

If you want it available on the client-side, you’d need to expose it in some way. Either encode it in the files being served up to the client’s browser or make an API call and request it from your server.

That said, often the information in VCAP_SERVICES is sensitive (contains passwords and secrets), so you’d want to be extremely careful about what you send down to the client/browser. Anything you send down to the client/browser will be visible to the client/browser and its human user. In short, someone using your app through a browser could also see that info, like through Browser Dev Tools.

Leave a comment