#pip install fastapi #pip install uvicorn import redis from fastapi import FastAPI,Form, Request import json import uvicorn import zipfile app = FastAPI() @app.get("/getbtn") def read_root(request: Request): r = redis.Redis(host='db.ptt.cx', port=6379, db=2,password='choozmo9') data=r.get('btn_data') return {'data':data} if __name__ == "__main__": uvicorn.run("main:app", host="0.0.0.0", port=9898,ssl_keyfile='/etc/letsencrypt/live/liff.googo.org/privkey.pem',ssl_certfile='/etc/letsencrypt/live/liff.googo.org/cert.pem') #--ssl-keyfile=/etc/letsencrypt/www.choozmo.com/privkey1.pem --ssl-certfile=/etc/letsencrypt/www.choozmo.com/cert1.pem #/etc/letsencrypt/live/liff.googo.org