'Heroku stopping all processes with SIGTERM after HTTP request to another Heroku app

I recently deployed 2 different apps on free Heroku's dynos.

One is an API and the other one is an admin panel.Both are working with NodeJS. My admin panel needs to make calls on to this api.

Everything is working fine when I'm launching those apps on localhost and on different ports. But when I deploy them to Heroku, both apps are being shut down by Heroku with the same error saying: "Stopping all processes with SIGTERM" and "process exited with status 143"

Here are the error messages I got in the Heroku logs: Heroku logs

I tried to use the CORS package to the two apps, but the issue didn't change. Some help or explanation would be appreciated. Thanks for your time !emphasized text



Solution 1:[1]

It's worth checking if this is expected behavior on the free dyno. I had one set up and switching to Hobby dyno fixed the issue. heroku node app exits after idling

Solution 2:[2]

this is due to inactivity, when there is a request on any endpoint heroku raises the dyno again

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Jeremy P. Beasley
Solution 2 Josué Tavares