package main import "net/http" func newRouter() http.Handler { mux := http.NewServeMux() mux.HandleFunc("/", handleRoot) mux.HandleFunc("/upload", handleUpload) mux.HandleFunc("/select", handleSelect) mux.HandleFunc("/process", handleProcess) mux.HandleFunc("/progress", handleProgress) mux.HandleFunc("/abort", handleAbort) mux.HandleFunc("/pause", handlePause) mux.HandleFunc("/resume", handleResume) mux.HandleFunc("/clear-completed", handleClearCompleted) mux.HandleFunc("/ws", handleWebSocket) mux.HandleFunc("/set-speed-limit", handleSetSpeedLimit) return withSecurityHeaders(mux) }