Skip to content

vildan-valeev/golang-htmx-grpc

Repository files navigation

Simple Project for testing HTMX with gRPC-Web


Sending HTML code parts from the backend as a string and inserting them into the DOM using htmx.

  1. https://htmx.org/docs/#extensions
  2. https://github.com/grpc/grpc-web/tree/master/net/grpc/gateway/examples/helloworld#compile-the-client-javascript-code

Start

  1. Generate js from proto file (optional, if doesn't exist api_pb.js, api_pb_web.js)
make js-proto
  1. Generate go package from proto file (optional, if doesn't exist api.pb.go, api_grpc.pb.go)
make go-proto
  1. Compile the client side JavaScript (optional, if doesn't exist main.js)
browserify grpc_ext.js -o main.js
  1. Run Proxy Server
docker compose up --build --remove-orphans
  1. Start Backend
go mod tidy
go build -o main main.go
./main
  1. Open index.html in Browser

Releases

No releases published

Packages

No packages published

Languages