Azure Database for MySQL – webapp nodejs

So I have been working on a web app with local mysql workbench. I recently moved the database to Azure Database for MySQL. Everything was working properly before I moved away from local. All my webpages were working properly, now only 2 out of the 4 pages work and I am running into the error below when I click on the broken pages. Below is how I am connecting to the database, I am not sure if the second connection is working.