I am working to develop a server with Node.js to request a postgreSQL database. My problem is, that I can't connect (with my local computer, using wifi connection, not ethernet) to this server, and also to the postgreSQL.
I have an username and a password to connect to the server, and also an another username and password to connect the database.
How can to connect both of those, and get the information I want from the postgreSQL database? Can I connect to this server with command bash like ssh but in node.js?
I did something like this:
var ssh = new SSH({
host: 'hostname',
user: 'user',
pass: 'password'
});
or something like this:
var connectionString = 'postgres://user:password@database:port';
I have another problem, my teacher give me a password containing a @, and I think this will make some problems when I have to put my password:
postgres://user:pass**@**word@database:port
How to bypass this password problem?
you need to pass ip address of machine where database resides in place of hostname.