INNER CODE UNIT · Go

init

machinebox/remoto · console/api/main.go:21

func init() {
	http.HandleFunc("/api/templates", handleTemplates())
	http.HandleFunc("/api/all.zip", handleRenderAllTemplates())
	http.HandleFunc("/api/templates/", handleRenderTemplate())
	http.HandleFunc("/api/define", handleDefinitionDefine())
}

// handleTemplates gets a list of available templates.
//	GET /api/templates
func handleTemplates() http.HandlerFunc {
	var init sync.Once
	var err error
	type template struct {
		Name         string   `json:"name"`
		Experimental bool     `json:"x"`
		Dirs         []string `json:"dirs"`
		Label        string   `json:"label"`
	}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…