from flask import Flask
from flask_restful import Resource, Api
app = Flask(name)
api = Api(app)
class Index(Resource):
def get(self):
return {'hello': 'world'}
api.add_resource(Index, '/index')
if name == 'main':
app.run(debug=True, host='0.0.0.0', port=443, ssl_context=('secret.pem', 'secret.key'))
证书:
openssl req -new -x509 -days 365 -nodes -out secret.pem -keyout secret.key
openssl pkcs8 -topk8 -inform PEM -outform PEM -in secret.key -out outfile.pem
网友评论