start /lookup
This commit is contained in:
parent
7458af2162
commit
735bfd8122
2
Makefile
2
Makefile
|
@ -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
14
http.go
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue