Answer the question
In order to leave comments, you need to log in
How to access mongodb database when uploading to VPS hosting?
Hello!
Tell me please.
The project was compiled, uploaded to VPS hosting, installed mongodb.
And how to handle mongodb?
On localhost, run vscode and the nodemon index.js script.
Do you also install vscode on the hosting and also run it?
Answer the question
In order to leave comments, you need to log in
Here is a rather rough description:
1) On the server where the database is running, there is also a web server (nginx), which hosts a system of scripts that work locally with the database (read Rest API, Graph QL, etc.) In large frameworks, regardless of the programming language, this functionality has already been implemented.
2) On your client computer, the client part of your software, via the http protocol, accesses the web server, your scripts, and through them works with the database.
3) VS code - needed for development. You don't need to host it. You can write something server-oriented in your local area, and then upload it to the server via SFTP
4) And yes, you can temporarily set up a web server and a database on the local area and test your code through the rest api. Then you just change the ip to which you address to the hosting ip and that's it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question