I tried this code, but it doesn’t work when the computer is turned off:
from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def home():
return "Active."
def run():
app.run(host='0.0.0.0',port=8080)
def keep_alive():
t = Thread(target=run)
t.start()