Browse Source

Makefile updated with version

master v1.1.0
Darshil Chanpura 2 years ago
parent
commit
90dfc4902a
  1. 1
      .gitignore
  2. 2
      Makefile
  3. 4
      main.go

1
.gitignore

@ -1 +1,2 @@
/.idea
release

2
Makefile

@ -21,7 +21,7 @@ test:
$(PLATFORMS):
GOOS=$(os) GOARCH=amd64 go build -o release/$(BINARY)
GOOS=$(os) GOARCH=amd64 go build -ldflags '-X main.version=$(VERSION)' -o release/$(BINARY)
tar -czf release/$(BINARY)-$(VERSION)-$(os)-amd64.tar.gz README.md -C release/ $(BINARY)
rm release/$(BINARY)

4
main.go

@ -11,6 +11,7 @@ import (
var (
localDir = "."
host = "0.0.0.0"
version = "latest"
port = 8000
user string
pass string
@ -40,10 +41,9 @@ func serve(addr string) {
Addr: addr,
Handler: NewLoggingHandler(mux, os.Stdout),
}
fmt.Printf("Serving at http://%s/ from %s\n", addr, localDir)
fmt.Printf("Serving with dumb-http/%s at http://%s/ from %s\n", version, addr, localDir)
err := server.ListenAndServe()
if err != nil {
log.Fatal(err)
}
}

Loading…
Cancel
Save