2👍
No, a Vue app runs code client-side, and need access to the file just like the browser does. You need to run your code server-side, if you don’t want to expose a file over HTTP.
1👍
You should not rely on security through obscurity.
Why are you trying to prevent access to this config.json
file?
If it is going to be accessed by the Vue client, it will by necessity be accessible to a determined user.
The public client is inherently insecure, and no amount of obfuscation would deter a necessarily determined attacker from accessing the content of the config file provided it is either existing on the client-side or is transferred via the network to the client.
The only way to ensure no public user can access the contents of the config.json
file is to handle it entirely server-side and process what needs to be done with it there.
Anything that touches the client-side, you should consider as accessible no matter how hidden or obfuscated.
- [Vuejs]-How to run a specific function if the component has been called by a specific component and not by other components in Vue?
- [Vuejs]-Disable autocomplete on Vuetify v-text-field