module
Version:
v0.0.0-...-b4891db
Opens a new window with list of versions in this module.
Published: Jan 19, 2022
License: MIT
Opens a new window with license information.
README
¶
twirp-example
The simplest example of Twirp.
Directory structure
- rpc/hello
- service.proto - RPC definition
- internal
- helloserver - Server implementation
- cmd
- server - main function for the server
Requirement
Build and run server
Build server.
$ make proto-gen
$ make build-server
Run the server.
$ ./server
Send request to the server
$ curl -X POST -H 'Content-Type: application/json' -d '{"message": "mercari.go #18"}' http://localhost:8080/twirp/twirp.example.hello.Hello/Echo
Directories
¶
Click to show internal directories.
Click to hide internal directories.