diff --git a/README.md b/README.md index cd0b984b..abb8c5fb 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ * 将 jzero 应用部署在 [Vercel](https://vercel.com), [模板仓库分支](https://github.com/jzero-io/templates/tree/api-vercel), [代码示例](https://github.com/jaronnie/go-serverless-vercel) * 基于 git change 生成代码, 极大提升大型项目开发体验 * 基于 jzero 的[后台管理系统](https://github.com/jzero-io/jzero-admin), [演示地址1-部署在vercel](https://admin.jzero.io), [演示地址2-部署在阿里云函数计算](https://jzero-admin.jaronnie.com) +* 基于 jzero 的 [serverless](https://docs.jzero.io/guide/serverless.html) 特性, 实现多模块解藕, 在编译阶段实现第三方模块的自动依赖注入 中文 | [ENGLISH](README-EN.md) diff --git a/docs/src/guide/new.md b/docs/src/guide/new.md index 32d97d77..f3ff1725 100644 --- a/docs/src/guide/new.md +++ b/docs/src/guide/new.md @@ -112,7 +112,7 @@ docker run --rm -v ${PWD}:/app ghcr.io/jzero-io/jzero:latest new your_project -- ``` ::: -## 场景五: 命令行项目 +## 场景四: 命令行项目 :::tip 基于 [cobra](https://github.com/spf13/cobra) 构建命令行项目 diff --git a/docs/src/guide/serverless.md b/docs/src/guide/serverless.md new file mode 100644 index 00000000..d690830c --- /dev/null +++ b/docs/src/guide/serverless.md @@ -0,0 +1,33 @@ +--- +title: serverless +icon: catppuccin:serverless +order: 3.5 +--- + +## 新建 core 核心模块 + +```shell +jzero serverless new core --core +cd core +jzero gen +go mod tidy +``` + +## 新建业务模块 + +```shell +cd core +jzero serverless new b1 +cd plugins/b1 +jzero gen +go mod tidy +``` + +## 构建 serverless + +```shell +cd core +jzero serverless build + +go run main.go server +``` \ No newline at end of file diff --git a/docs/src/guide/template.md b/docs/src/guide/template.md index 5142a18b..59fc6f51 100644 --- a/docs/src/guide/template.md +++ b/docs/src/guide/template.md @@ -1,5 +1,5 @@ --- -title: 模版 +title: 模版特性 icon: vscode-icons:folder-type-template star: true order: 5.3