This is the simplest way for HTTP servers to use this package. Call HTTPS() with your domain names and your handler (or nil for the http.DefaultMux), and CertMagic will do the rest.
()
| 24 | // Call HTTPS() with your domain names and your handler (or nil |
| 25 | // for the http.DefaultMux), and CertMagic will do the rest. |
| 26 | func ExampleHTTPS() { |
| 27 | http.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) { |
| 28 | fmt.Fprintf(w, "Hello, HTTPS visitor!") |
| 29 | }) |
| 30 | |
| 31 | err := HTTPS([]string{"example.com", "www.example.com"}, nil) |
| 32 | if err != nil { |
| 33 | log.Fatal(err) |
| 34 | } |
| 35 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…