func main() {
	fmt.Println("onthefly", onthefly.Version)
	n := negroni.Classic()
	mux := http.NewServeMux()
	svgurl := "/circles.svg"
	mux.HandleFunc(svgurl, func(w http.ResponseWriter, req *http.Request) {
		w.Header().Add("Content-Type", "image/svg+xml")
		w.Write(svgImage())
	})
	page := indexPage(svgurl)
	page.Publish(mux, "/", "/style.css", false)
	n.UseHandler(mux)
	n.Run(":3000")
}
Set up the paths and handlers then start serving.
package main
import (
	"fmt"
	"net/http"
	"github.com/urfave/negroni"
	"github.com/xyproto/onthefly"
	"github.com/xyproto/tinysvg"
)
func svgImage() []byte {
	document, svg := tinysvg.NewTinySVG(128, 64)
	svg.Describe("Hello SVG")
	svg.Circle(30, 10, 5, "red")
	svg.Circle(110, 30, 2, "green")
	svg.Circle(80, 40, 7, "blue")
	svg.Text(3, 60, 6, "Courier", "There will be cake", "#394851")
	return document.Bytes()
}
func indexPage(svgurl string) *onthefly.Page {
	page := onthefly.NewHTML5Page("Demonstration")
	page.AddContent(fmt.Sprintf("onthefly %.1f", onthefly.Version))
	page.SetMargin(4)
	page.SetFontFamily("serif")  
	page.SetColor("black", "#d0d0d0")
	body, err := page.GetTag("body")
	if err == nil {
		body.AddStyle("font-size", "2em")
		body.AddStyle("font-family", "sans-serif")
		p := body.AddNewTag("p")
		p.AddStyle("margin-top", "2em")
		img := p.AddNewTag("img")
		img.AddAttrib("src", svgurl)
		img.AddAttrib("alt", "Three circles")
		img.AddStyle("width", "60%")
		img.AddStyle("border", "4px solid white")
	}
	return page
}