devtools/hackdoc: init
This is hackdoc, a documentation rendering tool for monorepos.
This is the first code iteration, that can only serve from a local git
checkout.
The code is incomplete, and is WIP.
Change-Id: I68ef7a991191c1bb1b0fdd2a8d8353aba642e28f
diff --git a/devtools/hackdoc/helpers.go b/devtools/hackdoc/helpers.go
new file mode 100644
index 0000000..dd7269f
--- /dev/null
+++ b/devtools/hackdoc/helpers.go
@@ -0,0 +1,18 @@
+package main
+
+import (
+ "fmt"
+ "net/http"
+)
+
+func handle404(w http.ResponseWriter, r *http.Request) {
+ logRequest(w, r, "404")
+ w.WriteHeader(http.StatusNotFound)
+ fmt.Fprintf(w, "404!\n")
+}
+
+func handle500(w http.ResponseWriter, r *http.Request) {
+ logRequest(w, r, "500")
+ w.WriteHeader(http.StatusNotFound)
+ fmt.Fprintf(w, "500 :(\n")
+}