As pointed out in the documentation here:
http://flask.pocoo.org/docs/dev/deploying/
While lightweight and easy to use, Flask’s built-in server is not
suitable for production as it doesn’t scale well.
Now if you are not in production or if it’s a tiny project, you can deploy the files on your server using a client like WinSCP. Then you connect to your server using a ssh client like Putty and finally run:
python your/path/api.py
You can run it as below if you want it to continue executing in the background after you close your Putty window
python your/path/api.py &
Finally if you want to see if your API script is running you can use:
ps -efHa|grep your/path/api.py
It will give you the process Id which you can kill with:
kill <process_id>