As stated before, this is my first nodejs project and so far I love it. Everything works fine in my local environment, but I just set it up to host in Plesk and the app itself runs fine until I try to query the database . I get the following error below and not sure how to fix it.
Can you double-check your DB configuration on your Wappler project?
Note there are two places where you configure the DB, one is for Wappler’s database manager, the other is for the actual NodeJS app. This is where you configure for the NodeJS app:
@Apple, thanks for the quick reply. Everything seems ok with my DB config. You mention two places, where is the other config at? I did have to manually change my db.json file on the remote hosting because when I created the DB there, it made me use a different username and password cause the one Wappler created wasn’t strong enough.
I had the same issue when setting my database up. The problem was (at least in my case) I was trying to connect to Digital Ocean and my IP address wasn’t allowed so it kept denying me from connecting. Make sure your database is accepting of outside sources. I hope this. helps.
Also, you do configure your database in two places, ones under the API’s and one under database. All test your targets to make sure everything is communicating properly.
@Parker_Jacobs thanks for the reply. ah yes the database configuration, I was thinking he meant a second config file. From what I can tell, the IP is allowed. I’ve tried allowing remote connections as well, no go.
I’m guessing you only changed one of the .json files containing the DB credentials, we don’t know if that file is used by the NodeJS app or Wappler’s database manager (hint: possibly the latter), so you need to change the other file as well.
To avoid similar problems in the future, I suggest you let Wappler upload the files instead of uploading them manually - make use of Wappler targets
Yea you’re probably right. I’m so old school, I forgot some of the features of Wappler that are there to make my life easier…haha Thanks for all the suggestions. I’ll let you know how it goes today.