From ded6e3b25bca083cabe21bda6f4d01f6766587bc Mon Sep 17 00:00:00 2001 From: Adam Mathes Date: Thu, 9 Feb 2017 19:40:44 -0800 Subject: initial commit (fmstatic -> snkt) --- web/web.go | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 web/web.go (limited to 'web') diff --git a/web/web.go b/web/web.go new file mode 100644 index 0000000..2a320ea --- /dev/null +++ b/web/web.go @@ -0,0 +1,11 @@ +package web + +import ( + "net/http" +) + +func Serve(addr string, webroot string) { + fs := http.FileServer(http.Dir(webroot)) + http.Handle("/", fs) + http.ListenAndServe(addr, nil) +} -- cgit v1.2.3