reprose

Basic Go package server
git clone _git@git.zakaria.org/reprose.git
Log | Files | Refs | README

commit fe5fac8f650a7180b366855ab90b8ae94c9b4b1f
parent eb3893b412854c59d327f20daade80a736f762c2
Author: zakaria <e-zk@users.noreply.github.com>
Date:   Tue, 11 Jan 2022 22:59:15 +1000

Actually use ListenAddr

Diffstat:
Mmain.go | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/main.go b/main.go @@ -50,7 +50,7 @@ func isGoGet(req *http.Request) bool { func printRepo(repo, path string) string { var b strings.Builder - // fmt.Fprintf(&b, "<a href=\"%s/%s\"><img src=\"%s/%s?status.svg\" alt=\"godocs.io\"/></a>", GoDocsRoot, path, GoDocsRoot, path) + //fmt.Fprintf(&b, "<a href=\"%s/%s\"><img src=\"%s/%s?status.svg\" alt=\"godocs.io\"/></a>", GoDocsRoot, path, GoDocsRoot, path) //fmt.Fprintf(&b, "[<a href=\"%s/%s\">docs</a>] ", GoDocsRoot, path) fmt.Fprintf(&b, "<a href=\"/%s\" title=\"%s/%s -> %s\">%s/%s</a> ", repo, Host, repo, path, Host, repo) return b.String() @@ -63,7 +63,7 @@ func main() { if req.URL.Path == "/" { w.Header().Set("Content-Type", "text/html; charset=utf-8") fmt.Fprintf(w, "<pre>%s\n\n", Title) - fmt.Fprintf(w, "Repos:\n") + fmt.Fprintf(w, "Packages:\n") for k, v := range Repos { //fmt.Fprintf(w, " — <a href=\"/%s\">%s/%s</a>\n", k, Host, k) fmt.Fprintf(w, " — %s\n", printRepo(k, v)) @@ -90,5 +90,5 @@ func main() { } } }) - http.ListenAndServe("127.0.0.1:8082", mux) + http.ListenAndServe(ListenAddr, mux) }