Update app.py
Browse files
app.py
CHANGED
|
@@ -30,7 +30,12 @@ MAX_QUEUE_LENGTH = int(os.environ.get('MAX_QUEUE_LENGTH', 0))
|
|
| 30 |
|
| 31 |
def create_app():
|
| 32 |
app = Flask(__name__)
|
| 33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
# Create a queue to hold tasks
|
| 35 |
task_queue = Queue()
|
| 36 |
queue_id = id(task_queue) # Generate a single queue_id for this worker
|
|
@@ -197,12 +202,7 @@ def create_app():
|
|
| 197 |
discover_and_register_blueprints(app)
|
| 198 |
|
| 199 |
return app
|
| 200 |
-
|
| 201 |
-
def home():
|
| 202 |
-
# 您可以返回一个简单的欢迎信息
|
| 203 |
-
return "API server is running. Please use the specific endpoints to interact."
|
| 204 |
-
# 或者返回一个更友好的 HTML 页面
|
| 205 |
-
# return "<h1>欢迎!这是一个API服务器。</h1>"
|
| 206 |
app = create_app()
|
| 207 |
|
| 208 |
if __name__ == '__main__':
|
|
|
|
| 30 |
|
| 31 |
def create_app():
|
| 32 |
app = Flask(__name__)
|
| 33 |
+
@app.route("/")
|
| 34 |
+
def home():
|
| 35 |
+
# 您可以返回一个简单的欢迎信息
|
| 36 |
+
return "API server is running. Please use the specific endpoints to interact."
|
| 37 |
+
# 或者返回一个更友好的 HTML 页面
|
| 38 |
+
# return "<h1>欢迎!这是一个API服务器。</h1>"
|
| 39 |
# Create a queue to hold tasks
|
| 40 |
task_queue = Queue()
|
| 41 |
queue_id = id(task_queue) # Generate a single queue_id for this worker
|
|
|
|
| 202 |
discover_and_register_blueprints(app)
|
| 203 |
|
| 204 |
return app
|
| 205 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 206 |
app = create_app()
|
| 207 |
|
| 208 |
if __name__ == '__main__':
|