aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/main.go b/main.go
new file mode 100644
index 0000000..e3d8d91
--- /dev/null
+++ b/main.go
@@ -0,0 +1,19 @@
+package main
+
+import (
+ "log"
+ "net/http"
+ "net/http/cgi"
+)
+
+func main() {
+ forwarder := &cgi.Handler{
+ Path: "/usr/lib/cgit/cgit.cgi",
+ Root: "/",
+ Env: []string{"CGIT_CONFIG=cgitrc"},
+ Dir: "/home/gibheer/projects/",
+ }
+ http.Handle("/assets/", http.StripPrefix("/assets", http.FileServer(http.Dir("/usr/share/webapps/cgit/"))))
+ http.Handle("/", forwarder)
+ log.Fatalf("server stopped working: %s", http.ListenAndServe(":8080", nil))
+}