aboutsummaryrefslogtreecommitdiff
path: root/main.go
blob: e3d8d9106d6400ca26172ae2a23dc54356cf28a2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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))
}