Hello World
快速开始
step 1. 编译运行layotto
下载 layotto 源码后,切换目录:
cd ${project_path}/cmd/layotto
构建:
go build -o layotto
运行:
./layotto -c ../../demo/rpc/http/example.json
step 2. 启动echoserver服务端
go run ${project_path}/demo/rpc/http/echoserver/echoserver.go
step 3. 通过GPRC接口发起调用
go run ${project_path}/demo/rpc/http/echoclient/echoclient.go -d 'hello layotto'
解释
- example.json配置文件中, 利用mosn的路由能力,将http header中id字段等于HelloService:1.0的请求,转发到本地8889端口
- echoserver会listen本地的8889端口
- echoclient中会发起GRPC请求到layotto,