开发者社区> 问答> 正文

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

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

展开
收起
花开富贵111 2024-08-19 09:06:36 19 0
1 条回答
写回答
取消 提交回答
  •  # index.py 
     import bottle 
    
     @bottle.route('/hello/<name>') 
     def index(name): 
     return "Hello world" 
    
     app = bottle.default_app() 
    
     if __name__ == '__main__': 
     bottle.run(host='localhost', port=8080, debug=True)
    

    在阿里云函数计算平台,创建函数时,将函数入口设置为index.app即可。

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

相关电子书

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