开发者社区> 问答> 正文

给出一个在阿里云函数计算上部署Flask项目的代码示例。

给出一个在阿里云函数计算上部署Flask项目的代码示例。

展开
收起
花开富贵111 2024-08-19 09:06:34 8 0
1 条回答
写回答
取消 提交回答
  •  # index.py 
     from flask import Flask 
     app = Flask(__name__) 
    
     @app.route('/') 
     def hello_world(): 
     return 'Hello, World!' 
    
     if __name__ == '__main__': 
     app.run(host="0.0.0.0", port=int("8001"))
    

    在配置函数的时候写上入口函数为index.app即可。

    2024-08-19 15:51:13
    赞同 2 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Hologres Serverless之路:揭秘弹性计算组 立即下载
Serverless开发平台: 让研发效能再提升 立即下载
Serverless 引领云上研发新范式 立即下载