# music-program **Repository Path**: chenlishi/music-program ## Basic Information - **Project Name**: music-program - **Description**: 基于云开发的一款音乐小程序,可以听歌,可以发布动态,搜索动态,查看播放历史,查看自己发布过的动态信息 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-03-25 - **Last Updated**: 2022-05-14 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 云开发 quickstart 这是云开发的快速启动指引,其中演示了如何上手使用云开发的三大基础能力: - 数据库:一个既可在小程序前端操作,也能在云函数中读写的 JSON 文档型数据库 - 文件存储:在小程序前端直接上传/下载云端文件,在云开发控制台可视化管理 - 云函数:在云端运行的代码,微信私有协议天然鉴权,开发者只需编写业务逻辑代码 ## 参考文档 - [云开发文档](https://developers.weixin.qq.com/miniprogram/dev/wxcloud/basis/getting-started.html) 主题色:#2E8B57 文字颜色:#515151 上传云函数前要 安装wx-server-sdk: npm install --save wx-server-sdk 安装请求库 npm install --save request npm install --save request-promise 引入请求库 const rp = require('request-promise'); 使用:rp(api).then(res=>).catch() 云函数路由优化 tcb-router 基于 koa 风格的⼩程序·云开发云函数轻量级类路由库,主要⽤于优化服务端函数处理逻辑 为什么要使用tcbrouter ⼀个⽤户在⼀个环境中使⽤的云函数数量有限,⽆法满⾜复杂的业务场景和需求 使用步骤: 下载 npm install --save tcb-router 引入 const tcbRouter = require('tcb-router') 使用: const app = new tcbRouter({event}) app.router('云函数名称',async(ctx,next)=>{ 代码... }) app.router('第二个云函数名称',async(ctx,next)=>{ 代码... }) ... //返回当前服务 return app.serve();