and it needs to be in the right order, too
This commit is contained in:
		
							
								
								
									
										2
									
								
								main.go
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								main.go
									
									
									
									
									
								
							@@ -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 == "/" {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user