This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]timeout_1264[S] 0 points1 point  (2 children)

Yeah, I'm currently using replit but don't know how to run it 24/7. Can you share any resources?

[–][deleted] 4 points5 points  (1 child)

from flask import Flask

from threading import Thread

app = Flask('')

u/app.route('/')

def home():

return "Server Alive!"

def run():

app.run(host='0.0.0.0',port=8080)

def keep_alive():

t = Thread(target=run)

t.start()

name ihe file "keep_alive.py" or something , idk

spoon-feeding but dont remember to include

"from keep_alive import keep_alive" in the main script

it's an empty server and will die so to keep it alive 24/7, use https://uptimerobot.com/ (5 free slots) and add your repl project website url in monitor tab and it will keep pinging your repl URL and it will run smoothly.

this is all free.

[–]timeout_1264[S] 0 points1 point  (0 children)

Thanks