aboutsummaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorAdam Mathes <adam@trenchant.org>2017-02-09 19:40:44 -0800
committerAdam Mathes <adam@trenchant.org>2017-02-09 19:40:44 -0800
commitded6e3b25bca083cabe21bda6f4d01f6766587bc (patch)
tree2855fa24e8b2f939bdf091f5faca411e7884ac83 /web
downloadsnkt-ded6e3b25bca083cabe21bda6f4d01f6766587bc.tar.gz
snkt-ded6e3b25bca083cabe21bda6f4d01f6766587bc.tar.bz2
snkt-ded6e3b25bca083cabe21bda6f4d01f6766587bc.zip
initial commit (fmstatic -> snkt)
Diffstat (limited to 'web')
-rw-r--r--web/web.go11
1 files changed, 11 insertions, 0 deletions
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)
+}