Skip to content

Instantly share code, notes, and snippets.

@ajsya
Last active May 15, 2025 06:34
Show Gist options
  • Save ajsya/31b89d1368fd7603924ecdf715d6e882 to your computer and use it in GitHub Desktop.
Save ajsya/31b89d1368fd7603924ecdf715d6e882 to your computer and use it in GitHub Desktop.
24/7 repl.it hosting script
from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def home():
return "I'm alive"
def run():
app.run(host='0.0.0.0',port=8080)
def keep_alive():
t = Thread(target=run)
t.start()
from keep_alive import keep_alive
keep_alive()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment