and it needs to be in the right order, too

This commit is contained in:
David 2022-04-17 11:38:21 -04:00
parent c5e90fa640
commit f71e630e63

View File

@ -20,11 +20,11 @@ func main() {
flag.StringVar(&hostname, "hostname", "localhost", "Hostname the Prusa Connect API is available at (assumes http)") flag.StringVar(&hostname, "hostname", "localhost", "Hostname the Prusa Connect API is available at (assumes http)")
var port string var port string
flag.StringVar(&port, "port", "3000", "Local port to run server on") flag.StringVar(&port, "port", "3000", "Local port to run server on")
flag.Parse()
config := Config{ config := Config{
PrinterHostname: "http://" + hostname, PrinterHostname: "http://" + hostname,
Port: port, Port: port,
} }
flag.Parse()
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
if r.URL.Path == "index.html" || r.URL.Path == "/" { if r.URL.Path == "index.html" || r.URL.Path == "/" {