I’m fairly new to the fullstack Web-Apps ecosystem and javascript frameworks, and i’ve been following a tutorial series for Vue.js + Axios + Nodemon + Express + MySQL and i have a few questions/problems that the guy does not address or maybe i couldn’t pick up on from his tutorials.
I have made my Connection string directly to access the MySQL DB on Hostinger from my local app with the connection string provided by hostinger itself and it connects perfectly and i can do every crud operation successfully.
But my API’s from the frontend are based on localhost, like:
await axios.get("http://localhost:5170/models/")
and the backend axios is set to listen to port 5170.
Question.1
If i am to deploy my app, what are the changes i need to make to access my db from my online app?
e.g:
await axios.get("https://website.com/models/")
Question.2
I run 2 commands when working on my app, one in backend “nodemon index.js”, makes my connection to the DB and makes the magic happen and one on frontend “npm run dev”, will i need to make changes to my app while preparing the app for upload with “npm run build” so the backend stuff runs automatically upon website load online?
Question.3
My nodemon connection to my Hostinger DB keeps disconnecting and closing the connection everytime i press ctrl + s in my code with the error “fatal = true”. Is it something that is supposed to be happening or should i be changing something?
Question.4
People state that the apps deployed should always be on https instead of http. How do i make sure of that?
Any and all responses will be greatly appreciated.
Thank you all very much for reading through all these questions and taking the time.
I tried searching online for the solutions but i couldn’t find/understand any as far as my understanding of the subject matter is concerned.
Omer Khan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.