https://git.jolheiser.com/tailroute.git
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
package main import ( "net/http" "go.jolheiser.com/tailroute" ) func main() { r := tailroute.Router{ Tailnet: http.HandlerFunc(tailnet), Funnel: http.HandlerFunc(funnel), } if err := r.Serve("tailroute", ".tailroute"); err != nil { panic(err) } } func tailnet(w http.ResponseWriter, r *http.Request) { w.Write([]byte("tailnet")) } func funnel(w http.ResponseWriter, r *http.Request) { w.Write([]byte("funnel")) }