Skip to content

Commit 8481915

Browse files
committed
feat(docs): update blog
1 parent 7939480 commit 8481915

2 files changed

Lines changed: 38 additions & 20 deletions

File tree

docs/src/blog/run-vercel-serverless-function.md

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@ icon: /icons/emojione-v1-rocket.svg
55

66
## jzero × Vercel: A Powerful Ecosystem Integration
77

8-
### Why Choose jzero + Vercel?
9-
108
**What is jzero?**
119

12-
**jzero** is an enhanced development tool based on the go-zero framework:
10+
[jzero](https://github.com/jzero-io/jzero) framework developed based on [go-zero framework](https://github.com/zeromicro/go-zero) and [go-zero/goctl tool](https://github.com/zeromicro/go-zero/tree/master/tools/goctl)
1311

1412
🏗️ **Generate Framework Code Through Templates**: Automatically generate framework code from description files (api → api framework code, proto → proto framework code, sql/remote database address → model code)
1513

@@ -27,14 +25,14 @@ icon: /icons/emojione-v1-rocket.svg
2725

2826
---
2927

30-
**Why Choose jzero + Vercel?**
28+
**Vercel Platform Advantages**
3129

32-
-**Zero Configuration Deployment**: Code generated by jzero is fully compatible with Vercel platform, deploy directly from Git repository without additional configuration
30+
-**Zero Configuration Deployment**: Deploy directly from Git repository without additional configuration, no need for your own server, no CI/CD process required
3331
-**Global Edge Network**: Leverage Vercel's global infrastructure to deploy Go functions to edge nodes closest to users, achieving millisecond-level response
3432
-**Free Domain and HTTPS**: Automatically get `.vercel.app` production-grade domain, built-in CDN acceleration and SSL certificates
3533
-**Preview Environment**: Automatically generate independent preview URL for each PR commit
3634

37-
> 💡 **Core Value**: jzero deeply integrates with Vercel ecosystem, letting Go developers enjoy frontend-level deployment experience! Automatically generate serverless functions that comply with Vercel specifications through `.api` definition, truly achieving "define once, run everywhere".
35+
> 💡 **Core Value**: jzero deeply integrates with Vercel ecosystem, letting Go developers enjoy frontend-level deployment experience! Automatically generate serverless functions that comply with Vercel specifications through `.api` definition, no need to deploy to your own server.
3836
3937
## Quick Start: One-Click Access to Vercel Ecosystem
4038

@@ -43,8 +41,17 @@ icon: /icons/emojione-v1-rocket.svg
4341
jzero provides a project template optimized for Vercel ecosystem, the generated code structure fully complies with Vercel platform specifications:
4442

4543
```bash
46-
# Create new Vercel serverless project
47-
jzero new jzero-api-vercel-example --branch api-vercel
44+
# Install jzero
45+
go install github.com/jzero-io/jzero@latest
46+
# Install related tools
47+
jzero check
48+
go install github.com/jzero-io/gorename@latest
49+
# Create new Vercel serverless project from remote template
50+
jzero new jzero-api-vercel-example --remote https://github.com/jzero-io/templates --branch api-vercel
51+
# Add new api
52+
jzero add api test
53+
# Generate code
54+
jzero gen
4855
```
4956

5057
**Project Structure**:
@@ -82,15 +89,16 @@ git remote add origin https://github.com/your-username/jzero-api-vercel-example.
8289
git push -u origin main
8390
```
8491

92+
Example repository: https://github.com/jaronnie/jzero-api-vercel-example
93+
8594
### Vercel Platform Auto-Recognition
8695

8796
1. Visit [Vercel Console](https://vercel.com/dashboard)
8897
2. Click "Add New Project"
89-
3. Import your GitHub repository
9098

99+
3. Import your GitHub repository
91100
> ![image-20260404112504507](https://oss.jaronnie.com/image-20260404112504507.png)
92-
93-
4. **jzero's configuration lets Vercel automatically recognize it as a Go project**
101+
4. **vercel.json configuration lets Vercel automatically recognize it as a Go project**
94102

95103
5. Click "Deploy"
96104

docs/src/zh-CN/blog/run-vercel-serverless-function.md

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@ icon: /icons/emojione-v1-rocket.svg
55

66
## jzero × Vercel:生态打通的强大组合
77

8-
### 为什么选择 jzero + Vercel?
9-
108
**什么是 jzero?**
119

12-
**jzero** 是基于 go-zero 框架开发的增强型开发工具:
10+
基于 [go-zero框架](https://github.com/zeromicro/go-zero) 以及 [go-zero/goctl工具](https://github.com/zeromicro/go-zero/tree/master/tools/goctl) 开发的 [jzero](https://github.com/jzero-io/jzero) 框架
1311

1412
🏗️ **通过模板生成基础框架代码**:基于描述文件自动生成框架代码(api → api 框架代码、proto → proto 框架代码、sql/远程数据库地址 → model 代码)
1513

@@ -27,27 +25,37 @@ icon: /icons/emojione-v1-rocket.svg
2725

2826
---
2927

30-
**为什么选择 jzero + Vercel**
28+
**Vercel 平台优势**
3129

32-
-**零配置部署**jzero 生成的代码完全兼容 Vercel 平台,从 Git 仓库直接部署,无需额外配置
30+
-**零配置部署**:从 Git 仓库直接部署,无需额外配置,无需自己的服务器,无需 ci/cd 流程
3331
-**全球边缘网络**:借助 Vercel 的全球基础设施,将 Go 函数部署到离用户最近的边缘节点,实现毫秒级响应
3432
-**免费域名与 HTTPS**:自动获得 `.vercel.app` 生产级域名,内置 CDN 加速和 SSL 证书
3533
-**预览环境**:每次提交 PR 自动生成独立预览 URL
3634

37-
> 💡 **核心价值**:jzero 深度打通 Vercel 生态,让 Go 开发者享受前端级别的部署体验!通过 `.api` 定义自动生成符合 Vercel 规范的无服务器函数,真正实现"一次定义,处处运行"
35+
> 💡 **核心价值**:jzero 深度打通 Vercel 生态,让 Go 开发者享受前端级别的部署体验!通过 `.api` 定义自动生成符合 Vercel 规范的无服务器函数,无需再部署到自己的服务器上
3836
3937
## 快速开始:一键接入 Vercel 生态
4038

41-
### 创建 Vercel 兼容项目
39+
### 创建 Vercel 项目
4240

4341
jzero 提供了专为 Vercel 生态优化的项目模板,生成的代码结构完全符合 Vercel 平台规范:
4442

4543
```bash
46-
# 创建新的 Vercel 无服务器项目
47-
jzero new jzero-api-vercel-example --branch api-vercel
44+
# 安装 jzero
45+
go install github.com/jzero-io/jzero@latest
46+
# 安装相关工具
47+
jzero check
48+
go install github.com/jzero-io/gorename@latest
49+
# 从远程模板创建新的 Vercel 无服务器项目
50+
jzero new jzero-api-vercel-example --remote https://github.com/jzero-io/templates --branch api-vercel
51+
# 添加新的 api
52+
jzero add api test
53+
# 生成代码
54+
jzero gen
4855
```
4956

5057
**项目结构**
58+
5159
```
5260
jzero-api-vercel-example/
5361
├── vercel/
@@ -82,6 +90,8 @@ git remote add origin https://github.com/your-username/jzero-api-vercel-example.
8290
git push -u origin main
8391
```
8492

93+
示例代码仓库地址: https://github.com/jaronnie/jzero-api-vercel-example
94+
8595
### Vercel 平台自动识别
8696

8797
1. 访问 [Vercel 控制台](https://vercel.com/dashboard)

0 commit comments

Comments
 (0)