Create stubs and limit page size

This commit is contained in:
bel
2020-04-13 02:19:56 +00:00
parent eec859ed48
commit 117ad922e2
8 changed files with 58 additions and 5 deletions

View File

@@ -12,6 +12,7 @@ var (
Public string
StoreAddr string
StoreNS string
Page int
)
func init() {
@@ -24,6 +25,7 @@ func New() {
}
as := args.NewArgSet()
as.Append(args.INT, "p", "port to listen on", 52222)
as.Append(args.INT, "page", "page size for requests", 20)
as.Append(args.STRING, "d", "dir with public files", "./public")
as.Append(args.STRING, "s", "mongodb address", "localhost:27017")
as.Append(args.STRING, "ns", "mongodb database", "cheqbooq")
@@ -31,6 +33,7 @@ func New() {
panic(err)
}
Port = fmt.Sprintf(":%d", as.GetInt("p"))
Page = as.GetInt("page")
Public = as.GetString("d")
StoreAddr = as.GetString("s")
StoreNS = as.GetString("ns")