Is there a way to set command line arguments for a Vue.js application? I am utilizing Vue 3 on the frontend which interacts with a Python backend (Flask) using Axios. Currently, I am defining the baseURL for Axios in my main.js file as follows:
import axios from 'axios'
axios.defaults.baseURL ='http://localhost:1234/';
For more versatility, I aim to retrieve the path ('http://localhost:1234/') from the command line, but I am unsure of how to accomplish this.
I start the frontend using npm in the following manner, specifying the host and port for the frontend:
npm run --prefix frontend dev -- --host frontendHostName --port frontendPortNumber
How can I enhance this process by introducing custom command line parameters for backend communication, such as --backendHost backendHostName etc.? And how can I access these parameters within my JavaScript code?
I am still new to JavaScript and Vue, and although I have reviewed some suggestions, I am struggling to find a solution to this issue.