Skip to content

Commit 4caf2e5

Browse files
authored
docs:start examples (apache#73)
1 parent 32dd1ee commit 4caf2e5

File tree

6 files changed

+60
-1
lines changed

6 files changed

+60
-1
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ Cargo.lock
33
**/*.rs.bk
44
.vscode/
55
.idea/
6+
.DS_Store
67
helloworld

README_CN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Dubbo-rust 目前还在开发阶段. 截至目前, 已经实现了基于HTTP2的
3232
## 开始使用
3333

3434
- Dubbo-rust 快速开始: [中文](https://dubbo.apache.org/zh/docs3-v2/rust-sdk/quick-start/), English
35-
- Dubbo-rust 教程: [Examples](https://github.com/apache/dubbo-rust/tree/main/examples)
35+
- Dubbo-rust 教程: [Examples](examples/READMED.md)
3636

3737
## 项目结构
3838

docs/images/eamples/client.png

278 KB
Loading

docs/images/eamples/dir-server.png

51.9 KB
Loading

docs/images/eamples/server.png

290 KB
Loading

examples/READMED.md

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# 使用VS Code 运行 Dubbo-rust
2+
3+
#### 首先我们拉下 Dubbo-rust 项目
4+
```shell
5+
git clone https://github.com/apache/dubbo-rust.git
6+
```
7+
#### 打开编辑器准备启动项目
8+
打开对应的 **Dubbo-rust** 项目
9+
在当前目录下创建一个新文件夹,名称为 **.vscode**
10+
11+
```shell
12+
mkdir .vscode
13+
```
14+
15+
创建个json文件,名称为launch.json,该文件 **.vscode** 目录下 将下文的内容复制到launch.json中
16+
17+
```json
18+
{
19+
// Use IntelliSense to learn about possible attributes.
20+
// Hover to view descriptions of existing attributes.
21+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
22+
"version": "0.2.0",
23+
"configurations": [
24+
{
25+
"type": "lldb",
26+
"request": "launch",
27+
"name": "greeter-server",
28+
"program": "${workspaceFolder}/target/debug/greeter-server",
29+
"args": [],
30+
"cwd": "${workspaceFolder}/examples/greeter/",
31+
"terminal": "console",
32+
"env": { }
33+
},
34+
{
35+
"type": "lldb",
36+
"request": "launch",
37+
"name": "greeter-client",
38+
"program": "${workspaceFolder}/target/debug/greeter-client",
39+
"args": [],
40+
"cwd": "${workspaceFolder}/examples/greeter/",
41+
"terminal": "console",
42+
"env": {}
43+
},
44+
]
45+
}
46+
```
47+
48+
#### 打开 examples/greeter/src/greeter 目录,选择server.rs
49+
50+
![image.png](../docs/images/eamples/dir-server.png)
51+
52+
#### 选择左侧的运行按钮,启动 server 服务
53+
54+
![image.png](../docs/images/eamples/server.png)
55+
56+
##### 启动 client 访问server 端
57+
58+
![image.png](../docs/images/eamples/client.png)

0 commit comments

Comments
 (0)