Open Leon16 opened 1 year ago
Syntax is correct and it should work. For taking input from CLI, you need to write additional code using either os.Args
, flag
or a package like cobra
.
@Leon16 can we close this issue? if there are no further questions or doubts?
I would like to know how I could use Mux for TSL configuration and handle https requests. Should I just implement the following to achieve it:
server := &http.Server{ Addr: ":" + port, ReadTimeout: 5 time.Minute, WriteTimeout: 10 time.Second, TLSConfig: &tls.Config{ServerName: host}, Handler: r,
}
if err := server.ListenAndServeTLS(srvCert, srvKey); err != nil { log.Fatal(err) }
Where the paths to host, port, sevCert and srvKey will be provided via command line call
Not sure this would work.