Always serve plugins folder with or without the --plugins

without --plugins, serve at `plugins_`, otherwise serve at `plugins`

Change-Id: I91202656ec60501fc826550294e5c5a48479ccca
This commit is contained in:
Tao Zhou
2019-11-13 17:26:41 -08:00
parent 02109bdb4e
commit 717a160028

View File

@@ -86,6 +86,9 @@ func main() {
log.Println("Local plugins from", "../plugins")
} else {
http.HandleFunc("/plugins/", handleProxy)
// Serve local plugins from `plugins_`
http.Handle("/plugins_/", http.StripPrefix("/plugins_/",
http.FileServer(http.Dir("../plugins"))))
}
log.Println("Serving on port", *port)
log.Fatal(http.ListenAndServe(*port, &server{}))