不想自己搭服务器?微信云开发(CloudBase)一条龙:云函数(Node/Python)+ 云数据库(文档型)+ 云存储。
最小云函数:
// cloudfunctions/hello/index.js
exports.main = async (event) => ({ msg: 'hello ' + (event.name || 'world') });
前端调用:
wx.cloud.init(); wx.cloud.callFunction({ name: 'hello', data: { name: '晚风' } });
云数据库:
const db = wx.cloud.database();
db.collection('posts').get().then(r => console.log(r.data));
适合个人博客、工具类小程序,省去运维。附件里前面几个模板都是「本地版」,接上云开发就能变「联网版」。原创教程,禁止违规商用。
楼主 · 2026-09-27 17:58 · 浏览 111
· 编辑于 2026-09-27 17:58

