Add webui to binary package

This commit is contained in:
Kevin Kandlbinder 2022-09-05 18:41:42 +02:00
parent 52b426cb6a
commit e0965b92e2
6 changed files with 141 additions and 4 deletions

20
webui/webuiNotIncluded.go Normal file
View file

@ -0,0 +1,20 @@
//go:build !withUI
// +build !withUI
package webui
//go:generate yarn
//go:generate yarn build
import (
"net/http"
)
func ServeUI() (http.Handler, error) {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(404)
w.Write([]byte("{\"error_code\": 404, \"error\": \"not_found\", \"note\": \"WebUI not included in build - visit https://veles.1in1.net/docs/tutorial-basics/install\"}"))
return
}), nil
}