𝗟e𝘃i T𝗼o𝗹s
قناة بسيطة
All tools are only for educational purposes
إظهار المزيدلم يتم تحديد البلدالفئة غير محددة
523
المشتركون
لا توجد بيانات24 ساعات
لا توجد بيانات7 أيام
لا توجد بيانات30 أيام
عدد المنشورات
جاري تحميل البيانات...
التفاعلات
التعليقات
نجوم تيليجرام
أفضل المنشورات حسب
جاري تحميل البيانات...
تحليل النشر
المشاركات | ديناميات المشاهدات | |||||
لا يوجد نص... | 69 | 1 | 0 | 4 | Loading... | |
flask health checkup app 👨💻 | 114 | 0 | 0 | 6 | Loading... | |
from flask import Flask, jsonify
from flask_cors import CORS
import os, logging, time
from datetime import datetime, timezone
app=Flask(__name__)
CORS(app)
logging.basicConfig(level=logging.INFO)
s=time.time()
@app.errorhandler(404)
def lovepreetog(e): return jsonify({'error':'Endpoint not found'}),404
@app.errorhandler(500)
def lovepreetog1(e): return jsonify({'error':'Internal server error'}),500
@app.route('/')
def lovepreetog2():
app.logger.info('Health check requested')
return jsonify({'status':'running','bot':'your bot name','service':'your service name'})
@app.route('/health')
def lovepreetog3(): return jsonify({'status':'healthy','timestamp':datetime.now(timezone.utc).isoformat()})
@app.route('/info')
def lovepreetog4():
return jsonify({'name':os.environ.get('SERVICE_NAME','your creation name'),'version':os.environ.get('VERSION','1.0.0'),'description':'your description','endpoints':{'/':'Health check','/health':'Detailed health status','/info':'Bot information','/metrics':'Basic performance metrics'}})
@app.route('/metrics')
def lovepreetog5(): return jsonify({'uptime_seconds':int(time.time()-s),'status':'operational'})
def lovepreetog6():
port=int(os.environ.get('PORT',8080))
app.run(host='0.0.0.0',port=port,debug=False,use_reloader=False)
if __name__=="__main__": lovepreetog6() | 115 | 0 | 0 | 0 | Loading... |

