initial commit

This commit is contained in:
Gibheer 2024-08-21 17:58:59 +02:00
commit a7b73a63cf
2 changed files with 22 additions and 0 deletions

3
go.mod Normal file
View File

@ -0,0 +1,3 @@
module gocgi
go 1.22.5

19
main.go Normal file
View File

@ -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))
}