How can I provide command line arguments for a vuejs application? I use vue 3 for my frontend that communicates with the python backend (flask) via axios. Right now, I am setting the baseURL for axios in my main.js like this:
import axios from 'axios'
axios.defaults.baseURL ='http://localhost:1234/';
To be more flexible, I want to read the path ('http://localhost:1234/') from command line, but I don't understand how to do that.
I'm starting the frontend with npm like this, providing the frontend's host and port:
npm run --prefix frontend dev -- --host frontendHostName --port frontendPortNumber
How do I extend this by custom command line parameters like for backend communication, e.g. --backendHost backendHostName etc.? And how do I access those within my javascript?
I am new to JavaScript and Vue and I already read some suggestions, but I still don't understand how to solve this.