我正试图获得一个“ Hello World!” Shopify应用程序启动,我遇到了问题。我正在使用Python的Flask,将其部署到我的 localhost:5000 ,然后使用ngrok将其实时发布到网络上。
ngrok配置看起来很成功,但是嵌入式应用程序(将其安装到我的开发者商店之后)出现以下错误:
502错误的网关/服务器返回了无效或不完整的响应
我用于ngrok的代码如下:
from flask_script import Manager
from helloshopify import create_app
from helloshopify.extensions import db
from helloshopify import config
from flask_ngrok import run_with_ngrok
manager = Manager(create_app)
run_with_ngrok(manager)
@manager.command
def run_debug():
"""run app in debug mode using adhoc ssl.
Make sure that in production you have valid certs.
"""
app = create_app(config.DefaultConfig)
app.run(debug=True, host='0.0.0.0', ssl_context='adhoc')
@manager.command
def initdb():
""" Initialize database.
"""
db.drop_all()
db.create_all()
db.session.commit()
if __name__ == "__main__":
manager.run()
我还在shopify应用设置中使用了ngrok提供的HTTPS URL。
反正有解决此问题的方法吗?