Last active
December 17, 2016 20:15
-
-
Save michaljemala/f5179e0e5c6aa348aa252d9348aab664 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"flag" | |
"fmt" | |
"log" | |
"net/http" | |
) | |
var ( | |
p = flag.String("p", ":8080", "port to serve on") | |
c = flag.String("c", "", "cert file") | |
k = flag.String("k", "", "key file") | |
) | |
func main() { | |
flag.Parse() | |
http.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) { fmt.Fprintf(w, "I am running!") }) | |
log.Fatal(http.ListenAndServeTLS(*p, *c, *k, nil)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment