-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
29 lines (24 loc) · 861 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
SHELL := /bin/bash
install:
go install github.com/bufbuild/buf/cmd/buf@latest
go install github.com/fullstorydev/grpcurl/cmd/grpcurl@latest
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install connectrpc.com/connect/cmd/protoc-gen-connect-go@latest
npm install --save-dev @bufbuild/buf @connectrpc/protoc-gen-connect-es @bufbuild/protoc-gen-es
npm install @connectrpc/connect @connectrpc/connect-web @bufbuild/protobuf
generate:
buf lint
buf generate
go mod tidy
serve:
go get golang.org/x/net/http2
go get connectrpc.com/connect
go run cmd/server/main.go
httpreq:
curl --header "Content-Type: application/json" \
--data '{"name": "Jane"}' \
http://localhost:8081/greet.v1.GreetService/Greet
grpcreq:
grpcurl -protoset <(buf build -o -) -plaintext \
-d '{"name": "Jane"}' \
localhost:8081 greet.v1.GreetService/Greet