| 71 | } |
| 72 | |
| 73 | func registerTopic(router *mux.Router, layout *template.Template, t fw.Topic) { |
| 74 | htmlRouter := router.NewRoute().PathPrefix("/" + t.Prefix() + "z").Subrouter() |
| 75 | jsonRouter := router.NewRoute().PathPrefix("/" + t.Prefix() + "j").Subrouter() |
| 76 | |
| 77 | tmpl := template.Must(template.Must(layout.Clone()).Parse("{{ define \"title\" }}" + t.Title() + "{{ end }}")) |
| 78 | t.Activate(fw.NewContext(htmlRouter, jsonRouter, tmpl)) |
| 79 | } |
| 80 | |
| 81 | // getLocalIP returns a non loopback local IP of the host |
| 82 | func getLocalIP() string { |