1 Star 8 Fork 7

腾讯云开发CloudBase/cloudbase-templates

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

Aqueduct 云托管示例

这个目录是基于云开发的一个 Aqueduct (Dart Server) 云托管示例,包含 Aqueduct 模板,可以基于 CloudBase Framework 框架将项目一键部署到云开发环境

线上演示地址

https://framework.service.tcloudbase.com/dartapp/

点击下方按钮使用 CloudBase Framework 可以在云端一键部署本项目到自己的云开发账号上。

部署一个 Aqueduct 云托管应用

步骤一. 准备工作

具体步骤请参照 准备云开发环境和 CloudBase CLI 命令工具

步骤二. 初始化应用示例

在命令行执行

cloudbase init --template dart

步骤三. 一键部署

进入到项目目录,在命令行执行

cloudbase framework:deploy

开发命令及配置

本地开发

brew install dart

pub global activate aqueduct

aqueduct serve

本地测试

pub run test

CloudBase Framework 相关开发配置

查看 CloudBase Framework 配置.

Aqueduct 开发文档

查看 starter

使用云数据库

模板里已经集成了云数据库,通过下列步骤便可快速开始。

步骤一. 注入环境信息和密钥

channel.dartprepare() 函数里,填入云数据库需要的信息

/// 初始化云数据库
database = CloudBaseDatabase(CloudBaseCore.init({
  /// 云开发环境 ID
  'env': 'your-env-id',
  /// 腾讯云 API 固定密钥对
  /// 获取路径: https://console.cloud.tencent.com/cam/capi
  'secretId': 'your-secretId',
  /// 同上
  'secretKey': 'your-secretKey'
}));

步骤二. 请求数据

部署服务后,访问子路径 /user,结果返回 user 集合的数量。

马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/TencentCloudBase/cloudbase-templates.git
git@gitee.com:TencentCloudBase/cloudbase-templates.git
TencentCloudBase
cloudbase-templates
cloudbase-templates
gitee

搜索帮助