跳到主要内容

Hello World

Quick Start

step 1. compile and start layotto

After downloading the project source code, change directory:

cd ${project_path}/cmd/layotto

and compile:

go build

Once finished, the layotto binary file will be generated in the directory.

Let's run it:

./layotto start -c ../../demo/rpc/http/example.json

step 2. start echoserver

go run ${project_path}/demo/rpc/http/echoserver/echoserver.go

step 3. call runtime InvokerService api.

go run ${project_path}/demo/rpc/http/echoclient/echoclient.go -d 'hello layotto'

rpchello.png

Explanation

  1. configure mosn to match http request header id equals HelloService:1.0, forward to localhost:8889
  2. echoserver listen at localhost:8889
  3. echoclient call the InvokeService grpc api.