1. Start with html/template
A Fir web page begins as a standard server-side rendered page which reloads to show the new state on user interaction. Click the buttons below to see it in action.
onEvent
functions registered for
inc
and dec
. The
action/formaction
attribute must be of the
format /?event=inc
where
inc
is the event name. Notice there is
no javascript in the page.
go run counter.go
Open your browser and go to http://localhost:9867 to see the counter in action.