diff --git a/cmd/tusd/cli/flags.go b/cmd/tusd/cli/flags.go index 35aaeec..1e1a647 100644 --- a/cmd/tusd/cli/flags.go +++ b/cmd/tusd/cli/flags.go @@ -20,6 +20,7 @@ var Flags struct { MaxSize int64 UploadDir string Basepath string + ShowGreeting bool Timeout int64 S3Bucket string S3ObjectPrefix string @@ -66,6 +67,7 @@ func ParseFlags() { flag.Int64Var(&Flags.MaxSize, "max-size", 0, "Maximum size of a single upload in bytes") flag.StringVar(&Flags.UploadDir, "upload-dir", "./data", "Directory to store uploads in") flag.StringVar(&Flags.Basepath, "base-path", "/files/", "Basepath of the HTTP server") + flag.BoolVar(&Flags.ShowGreeting, "show-greeting", true, "Show the greeting message") flag.Int64Var(&Flags.Timeout, "timeout", 6*1000, "Read timeout for connections in milliseconds. A zero value means that reads will not timeout") flag.StringVar(&Flags.S3Bucket, "s3-bucket", "", "Use AWS S3 with this bucket as storage backend (requires the AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY and AWS_REGION environment variables to be set)") flag.StringVar(&Flags.S3ObjectPrefix, "s3-object-prefix", "", "Prefix for S3 object names") diff --git a/cmd/tusd/cli/serve.go b/cmd/tusd/cli/serve.go index aad6ad1..3cbd718 100644 --- a/cmd/tusd/cli/serve.go +++ b/cmd/tusd/cli/serve.go @@ -71,7 +71,9 @@ func Serve() { http.Handle("/", http.StripPrefix("/", handler)) } else { // If a custom basepath is defined, we show a greeting at the root path... - http.HandleFunc("/", DisplayGreeting) + if Flags.ShowGreeting { + http.HandleFunc("/", DisplayGreeting) + } // ... and register a route with and without the trailing slash, so we can // handle uploads for /files/ and /files, for example.