Skip to content

Instantly share code, notes, and snippets.

@michaljemala
Last active December 17, 2016 20:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaljemala/f5179e0e5c6aa348aa252d9348aab664 to your computer and use it in GitHub Desktop.
Save michaljemala/f5179e0e5c6aa348aa252d9348aab664 to your computer and use it in GitHub Desktop.
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