start /lookup

This commit is contained in:
Jeff Carr 2025-06-30 08:43:50 -05:00
parent 7458af2162
commit 735bfd8122
2 changed files with 16 additions and 0 deletions

View File

@ -28,6 +28,8 @@ install:
prod: build
make stop
cp gowebd /usr/bin/gowebd
# allow the binary to open ports below 1024
setcap 'cap_net_bind_service=+ep' /usr/bin/gowebd
make start
make log

14
http.go
View File

@ -78,6 +78,20 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
return
}
if route == "/lookup" {
w.Header().Set("Content-Type", "text")
fmt.Fprintf(w, "go.wit.com/apps/utils/gowebd Version: %s\n", argv.Version())
fmt.Fprintf(w, "\n")
all := forge.Repos.SortByFullPath()
for all.Scan() {
repo := all.Next()
fmt.Fprintf(w, "Namespace=%s FullPath=%s %s\n", repo.Namespace, repo.FullPath)
}
return
}
if route == "/goReference.svg" {
writeFile(w, "goReference.svg")
return