Sending HTML code parts from the backend as a string and inserting them into the DOM using htmx.
- https://htmx.org/docs/#extensions
- https://github.com/grpc/grpc-web/tree/master/net/grpc/gateway/examples/helloworld#compile-the-client-javascript-code
- Generate js from proto file (optional, if doesn't exist
api_pb.js
,api_pb_web.js
)
make js-proto
- Generate go package from proto file (optional, if doesn't exist
api.pb.go
,api_grpc.pb.go
)
make go-proto
- Compile the client side JavaScript (optional, if doesn't exist
main.js
)
browserify grpc_ext.js -o main.js
- Run Proxy Server
docker compose up --build --remove-orphans
- Start Backend
go mod tidy
go build -o main main.go
./main
- Open
index.html
in Browser