You shouldn't connect to your database via a GET request. It is bad practice and not recommended:
docs.mlab.com/data-api
"The first method - the one we strongly recommend - is to connect using one of the available MongoDB drivers. You do not need to use our API if you use the driver. In fact, using a driver provides better performance, better security, and more functionality.
The second method, documented in this article, is to connect via mLab’s RESTful Data API. Use this method only if you cannot connect using a MongoDB driver."
Your api is presumably in your heroku app, so you just set is as a relative path to the root. This is handled in server.js and you shouldn't have to change it: github.com/Hashnode/mern-starter/blob/master/serv…
You might to modify the start script in package.json and set the env to production like NODE_ENV=production. See step 5 in the tutorial above.