from flask import Flask,jsonify
app = Flask(__name__)
#app.config['SERVER_NAME'] = 'example.com'

@app.route('/')
def hello_world():
data = {'data':[{'name': 'test', 'image': 'https://img3.doubanio.com/icon/u1074067-64.jpg', 'update': 1}]}
return jsonify(data)

if __name__ == '__main__':
app.run( debug=True, port=5000, ssl_context=('server.crt','server.key'))

pip install pyopenssl 用这个第三方包的话,
ssl_context=('server.crt','server.key') 替换成
ssl_context='adhoc'即可

相关文章:

  • 2021-09-25
  • 2021-11-26
  • 2021-06-28
  • 2021-08-22
  • 2022-12-23
  • 2022-12-23
  • 2021-10-25
  • 2021-06-24
猜你喜欢
  • 2021-11-23
  • 2021-06-09
  • 2021-12-06
  • 2021-04-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案