Add configurable listen port and Makefile
Signed-off-by: Aoi K <koizumi.aoi@chaotic.ninja> git-svn-id: file:///srv/svn/repo/toyohime/trunk@108 922d331f-388e-da47-97a9-ad700dc0b8b9
This commit is contained in:
parent
62cd7abf7a
commit
5c95c8fdd1
10
Makefile
Normal file
10
Makefile
Normal file
@ -0,0 +1,10 @@
|
||||
GO ?= go
|
||||
GOFLAGS ?= -v
|
||||
PREFIX ?= /usr/local
|
||||
|
||||
vanityserver:
|
||||
$(GO) build $(GOFLAGS) ./cmd/$@
|
||||
install:
|
||||
install -m0755 vanityserver $(PREFIX)/bin/vanityserver
|
||||
uninstall:
|
||||
rm -f $(PREFIX)/bin/vanityserver
|
@ -38,13 +38,14 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"go.jonnrb.io/vanity"
|
||||
"git.chaotic.ninja/koizumi.aoi/vanity"
|
||||
)
|
||||
|
||||
var (
|
||||
showIndex = flag.Bool("index", false, "Show a list of repos at /")
|
||||
noHealthz = flag.Bool("nohealthz", false, "Disable healthcheck endpoint at /healthz")
|
||||
watch = flag.Bool("watch", false, "Watch repos file for changes and reload")
|
||||
listenPort = flag.String("listen", ":8080", "Port to bind on")
|
||||
)
|
||||
|
||||
var (
|
||||
@ -179,7 +180,7 @@ func buildServer(h http.Handler) *http.Server {
|
||||
WriteTimeout: 5 * time.Second,
|
||||
IdleTimeout: 5 * time.Second,
|
||||
|
||||
Addr: ":8080",
|
||||
Addr: *listenPort,
|
||||
Handler: h,
|
||||
}
|
||||
}
|
||||
|
2
go.mod
2
go.mod
@ -1,4 +1,4 @@
|
||||
module go.jonnrb.io/vanity
|
||||
module git.chaotic.ninja/koizumi.aoi/vanity
|
||||
|
||||
go 1.14
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user