在 meeting-simple/cloudbaserc.json 文件中声明静态资源、云函数和数据库等各个资源的构建和部署信息
{ "envId": "{{env.ENV_ID}}", "$schema": "https://framework-1258016615.tcloudbaseapp.com/schema/latest.json", "version": "2.0", "functionRoot": "cloudfunctions", "framework": { "plugins": { "client": { "use": "@cloudbase/framework-plugin-website", "inputs": { "buildCommand": "npm run build", "outputPath": "build", "cloudPath": "/meeting-simple", "envVariables": { "REACT_APP_ENV_ID": "{{env.ENV_ID}}" } } }, "db": { "use": "@cloudbase/framework-plugin-database", "inputs": { "collections": [ { "collectionName": "meeting-simple", "aclTag": "READONLY" }, { "collectionName": "meeting-simple-pass" } ] } }, "server": { "use": "@cloudbase/framework-plugin-function", "inputs": { "functionRootPath": "cloudfunctions", "functions": [ { "name": "autoclear-meeting-meeting-simple", "triggers": [ { "name": "clear-time-trigger", "type": "timer", "config": "0 0 2 * * * *" } ] }, { "name": "join-meeting-meeting-simple" }, { "name": "create-meeting-meeting-simple" }, { "name": "update-ticket-meeting-simple" } ] } } } } }执行 ClouBase Framework 的一键部署命令
cloudbase framework deploy更多 CloudBase Framework 插件可阅读 代码提交记录
本步骤对应的 git commit
总结在本次实战案例里面,我们通过了解了 WebRTC 的基本使用,通过在线会议系统的实战了解了基于云开发开发一个应用的完整流程,学会使用了数据库实时推送能力的使用、匿名用户使用数据库的安全策略问题及云函数定时调用功能,掌握了使用 CloudBase Framework 一键部署前后端应用这一工具来快速交付。
CloudBase Framework 开源项目介绍