From 9361b3f64d76774cf0db234c54d481f05baae65e Mon Sep 17 00:00:00 2001 From: Eliot Whalan Date: Thu, 23 Jun 2016 11:06:52 +1000 Subject: [PATCH] Add index page --- main.go | 1 + static/index.html | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 static/index.html diff --git a/main.go b/main.go index e646a39..31d28c0 100644 --- a/main.go +++ b/main.go @@ -214,6 +214,7 @@ func pasteHandler(w http.ResponseWriter, r *http.Request) { func main() { router := mux.NewRouter().StrictSlash(true) + router.PathPrefix("/").Handler(http.StripPrefix("/", http.FileServer(http.Dir("static/")))) router.HandleFunc("/p/{pasteId}", pasteHandler) router.HandleFunc("/p/{pasteId}/{lang}", langHandler) router.HandleFunc("/save", saveHandler) diff --git a/static/index.html b/static/index.html new file mode 100644 index 0000000..f987c81 --- /dev/null +++ b/static/index.html @@ -0,0 +1,12 @@ + + + + + +
+ + +
+ + +