-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
38 lines (32 loc) · 1021 Bytes
/
Copy pathapp.py
File metadata and controls
38 lines (32 loc) · 1021 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
from flask import Flask
from routes.task_routes import tasks_bp
from routes.auth_routes import auth_bp
from utils.responses import error_response
from config import Config
app = Flask(__name__)
app.register_blueprint(tasks_bp)
app.register_blueprint(auth_bp)
@app.route("/", methods=["GET"])
def home():
return {
"name": "Task Queue API",
"features": [
"JWT auth",
"task processing",
"retry logic",
"PostgreSQL",
"Docker",
"Redis"
],
"github": "https://github.com/raynercodes/task-queue-api.git",
"message": "Task Queue API is running check Github README for endpoints.",
"status": "running"
}
@app.errorhandler(ValueError)
def handle_value_error(e):
return error_response(str(e), status=400)
@app.errorhandler(Exception)
def handle_internal_error(e):
return error_response(str(e), status=500)
if __name__ == "__main__":
app.run(host="0.0.0.0", port=Config.PORT, debug=False)