diff --git a/plugins/cli/cli.go b/plugins/cli/cli.go index d46357b..fa0ca2a 100644 --- a/plugins/cli/cli.go +++ b/plugins/cli/cli.go @@ -10,7 +10,6 @@ import ( "github.com/velour/catbase/bot" "github.com/velour/catbase/bot/msg" "github.com/velour/catbase/bot/user" - "io/ioutil" "net/http" "time" ) @@ -83,13 +82,7 @@ func (p *CliPlugin) handleWebAPI(w http.ResponseWriter, r *http.Request) { } func (p *CliPlugin) handleWeb(w http.ResponseWriter, r *http.Request) { - f, err := ioutil.ReadFile("plugins/cli/index.html") - if err != nil { - w.WriteHeader(500) - fmt.Fprint(w, err) - return - } - w.Write(f) + fmt.Fprint(w, indexHTML) } // Completing the Connector interface, but will not actually be a connector diff --git a/plugins/cli/index.html b/plugins/cli/index.go similarity index 99% rename from plugins/cli/index.html rename to plugins/cli/index.go index 36fd8c4..09b4364 100644 --- a/plugins/cli/index.html +++ b/plugins/cli/index.go @@ -1,3 +1,6 @@ +package cli + +var indexHTML = ` @@ -135,3 +138,4 @@ +`