Initial UNC file watcher web console

This commit is contained in:
Codex
2026-04-17 17:08:49 +08:00
commit 1d283d540c
10 changed files with 1931 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
package main
import (
"flag"
"log"
"net/http"
)
func main() {
log.SetFlags(log.LstdFlags | log.Lmicroseconds)
listenAddr := flag.String("listen", defaultListen, "web UI listen address, for example 127.0.0.1:18080")
flag.Parse()
application := newApp()
mux := http.NewServeMux()
mux.HandleFunc("/", application.handleIndex)
mux.HandleFunc("/start", application.handleStart)
mux.HandleFunc("/stop", application.handleStop)
log.Printf("web UI listening at http://%s", *listenAddr)
log.Printf("open the address in your browser and configure the watcher there")
if err := http.ListenAndServe(*listenAddr, mux); err != nil {
log.Fatalf("web server stopped: %v", err)
}
}