diff options
author | Gibheer <gibheer+git@zero-knowledge.org> | 2024-08-21 17:58:59 +0200 |
---|---|---|
committer | Gibheer <gibheer+git@zero-knowledge.org> | 2024-08-21 17:58:59 +0200 |
commit | a7b73a63cf46c84fce6000b91a88226d374d12b4 (patch) | |
tree | 6d07eac33f9f1eba30442c43bc4bd1901e5b9542 /main.go |
initial commit
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -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)) +} |