DEBUG ─ Resolving the template's static variables.DEBUG ─ Collecting components from the template.DEBUG ─ Downloading any NPM components found in the template.DEBUG ─ Analyzing the template's components dependencies.DEBUG ─ Creating the template's components graph.DEBUG ─ Syncing template state.DEBUG ─ Executing the template's components graph.DEBUG ─ Starting API-Gateway deployment with name APIService in the ap-shanghai region... ...DEBUG ─ Updating configure...DEBUG ─ Created function Album_Get_Photo_Search successfulDEBUG ─ Setting tags for function Album_Get_Photo_SearchDEBUG ─ Creating trigger for function Album_Get_Photo_SearchDEBUG ─ Deployed function Album_Get_Photo_Search successfulDEBUG ─ Uploaded package successful /Users/dfounderliu/Documents/code/AIAlbum/.serverless/Album_Prediction.zipDEBUG ─ Creating function Album_PredictionDEBUG ─ Updating code...DEBUG ─ Updating configure...DEBUG ─ Created function Album_Prediction successfulDEBUG ─ Setting tags for function Album_PredictionDEBUG ─ Creating trigger for function Album_PredictionDEBUG ─ Trigger timer: timer not changedDEBUG ─ Deployed function Album_Prediction successfulConf:region:ap-shanghai... ...-path:/photo/deletemethod: ANYapiId:api-g9u6r9wq-path:/album/deletemethod: ANYapiId:api-b4c4xrq8-path:/album/addmethod: ANYapiId:api-ml6q5koy156s › APIService › done 这个过程只用了 156s 就部署了所有函数,然后打开小程序的 id 带入miniProgram目录,并且填写自己的appid在文件project.config.json的第 17 行,同时也要配置自己项目的基础目录,就是 API 网关给我们返回的地址,写在app.js的第 10 行,此时项目就可以运行起来了 。总结本文中的例子是通过 Serverless 架构使用 Python 语言开发了一个微信小程序,这里面涉及到了数据库的增删改查,公共组件的提取,如何定义 Components 的全局变量,如何本地调试和线上触发二者兼得,以及在什么地方初始化数据库"性价比较高" 。希望通过这样一个简单的例子,可以让 Serverless 在更多的领域都有实际的应用价值,可以给更多人灵感和启发:Serverless?万物都可以 Serverless 么?让我们一起来尝试更多 Serverless 架构的应用领域吧 。
推荐阅读
- 基于Bert和通用句子编码的Spark-NLP文本分类
- eHIDS 一款基于eBPF的HIDS开源工具
- 基于零信任的安全架构
- 教你编译一个基于arm的Linux内核,并用qemu模拟器测试
- 基于机器学习的自适应码率算法的进一步探索与改进
- 基于Modbus协议实现Openplc与Kingview的仿真通讯与模拟测试
- 基于oAuth的授权登陆
- 附代码 基于NLP的COVID-19虚假新闻检测
- 如何基于TCP/IP协议进行MFC Socket网络通讯编程
- 内网渗透基础——命令行下安装Microsoft .NET Framework
