Go Dynamic Web Sample
Description
This sample project is a basic Go web server with server side rendered html. Dynamic components are enabled via html fragments sent over a websocket. On the client side the dom is updated via morphdom.
This approach is similar to Phoenix LiveView, Hotwire, and others.
Tailwind CSS is used for the basic styling and esbuild for bundling.
Running Sample
Start tailwind watcher.
npm run tailwind
Run esbuild to bundle javascript
npm run esbuild
Run go server
go run main.go
If you visit http://localhost:8080 you will see a timestamp that updates every second and the live number of connections. Open another instance in a different tab to see the connection count go up.