Commit 52d96bae authored by Quentin Smith's avatar Quentin Smith

storage/localserver: cleanup flags

This adds a -view_url_base flag to set the view URL base, and renames
-port to -addr to match analysis/localserver.

Change-Id: I2903ec0814c630345c212dac10a0f36567aab5ec
Reviewed-on: https://go-review.googlesource.com/37533Reviewed-by: default avatarRuss Cox <rsc@golang.org>
parent ade13b72
......@@ -15,7 +15,10 @@ import (
"golang.org/x/perf/storage/fs"
)
var host = flag.String("port", ":8080", "(host and) port to bind on")
var (
addr = flag.String("addr", ":8080", "serve HTTP on `address`")
viewURLBase = flag.String("view_url_base", "", "/upload response with `URL` for viewing")
)
func main() {
flag.Parse()
......@@ -26,10 +29,15 @@ func main() {
}
fs := fs.NewMemFS()
app := &app.App{DB: db, FS: fs, Auth: func(http.ResponseWriter, *http.Request) (string, error) { return "", nil }}
app := &app.App{
DB: db,
FS: fs,
ViewURLBase: *viewURLBase,
Auth: func(http.ResponseWriter, *http.Request) (string, error) { return "", nil },
}
app.RegisterOnMux(http.DefaultServeMux)
log.Printf("Listening on %s", *host)
log.Printf("Listening on %s", *addr)
log.Fatal(http.ListenAndServe(*host, nil))
log.Fatal(http.ListenAndServe(*addr, nil))
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment