From aff09ed2a1b3e6182bc7801fc6ed96759301c586 Mon Sep 17 00:00:00 2001 From: Stephen McQuay Date: Wed, 8 May 2013 22:43:18 -0700 Subject: [PATCH] added initial go file --- main.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 main.go diff --git a/main.go b/main.go new file mode 100644 index 0000000..7ffa295 --- /dev/null +++ b/main.go @@ -0,0 +1,22 @@ +package main + +import ( + "flag" + "github.com/gorilla/sessions" + "log" + "net/http" +) + +var addr = flag.String("addr", ":8000", "address I'll listen on.") +var static_files = flag.String("static", "./static", "location of static files") + +var store = sessions.NewCookieStore([]byte("hello world")) + +func main() { + flag.Parse() + http.Handle("/", + http.FileServer(http.Dir(*static_files))) + if err := http.ListenAndServe(*addr, nil); err != nil { + log.Fatal("ListenAndServe:", err) + } +}