optional API path prefix
This commit is contained in:
@@ -13,6 +13,7 @@ type Config struct {
|
||||
Database string
|
||||
Driver []string
|
||||
FilePrefix string
|
||||
APIPrefix string
|
||||
FileRoot string
|
||||
Auth bool
|
||||
AuthLifetime time.Duration
|
||||
@@ -33,6 +34,7 @@ func New() Config {
|
||||
|
||||
as.Append(args.INT, "p", "port to listen on", 18114)
|
||||
as.Append(args.STRING, "fileprefix", "path prefix for file service", "/__files__")
|
||||
as.Append(args.STRING, "api-prefix", "path prefix for api", "api")
|
||||
as.Append(args.STRING, "fileroot", "path to file hosting root", "/tmp/")
|
||||
as.Append(args.STRING, "database", "database name to use", "db")
|
||||
as.Append(args.STRING, "driver", "database driver args to use, like [local/storage.Type,arg1,arg2...] or [/path/to/boltdb]", "map")
|
||||
@@ -60,5 +62,6 @@ func New() Config {
|
||||
MaxFileSize: int64(as.GetInt("max-file-size")),
|
||||
RPS: as.GetInt("rps"),
|
||||
SysRPS: as.GetInt("sys-rps"),
|
||||
APIPrefix: strings.TrimPrefix(as.GetString("api-prefix"), "/"),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user