Spaces:
Running
Running
alptangall
commited on
Update server.py
Browse files
server.py
CHANGED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from flask import Flask
|
2 |
+
from threading import Thread
|
3 |
+
import sys
|
4 |
+
|
5 |
+
|
6 |
+
app = Flask('')
|
7 |
+
|
8 |
+
@app.route('/')
|
9 |
+
def main():
|
10 |
+
return 'Bot ready!'
|
11 |
+
sys.exit("Error message")
|
12 |
+
|
13 |
+
def run():
|
14 |
+
app.run(host='0.0.0.0', port=8888)
|
15 |
+
|
16 |
+
def b():
|
17 |
+
server = Thread(target=run)
|
18 |
+
server.start()
|
19 |
+
|