'Running a Python Flask server in closed Terminal session

I've made an Flask API Server that i want to run on a Server and close the Terminal session and still keep it running. (SSH) The API's makes a lot of Requests to other servers and uses Threading to make this Process faster.

I've tried the setsid command, and this works fine until i close the Terminal session. Because when its closed, i am only getting 500 errors.



Sources

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

Source: Stack Overflow

Solution Source