Makes the dev file built more gulp-ish way

This commit is contained in:
2016-02-23 18:22:21 +01:00
parent 603943c4a1
commit 924ea137b9
6 changed files with 97 additions and 28 deletions

View File

@@ -27,6 +27,7 @@ type Options struct {
RequestWindow time.Duration `long:"request-window" description:"Window over which no more --max-request are done"`
CacheTTL time.Duration `long:"chache-ttl" description:"TTL of the cached data" `
BatchSize int `long:"batch-size" description:"Sizes of the batch for indexing" default:"1000"`
BasePath string `long:"basepath" short:"b" description:"basepath of the webapp" default:"dist/prod"`
}
type appData struct {
@@ -378,7 +379,7 @@ func Execute() error {
log.Printf("Listening on %s", opts.Listen)
a.start(srv.StopChan())
srv.Server.Handler = a.buildRouter()
srv.Server.Handler = a.buildRouter(opts.BasePath)
if err := srv.ListenAndServe(); err != nil {
if opErr, ok := err.(*net.OpError); !ok || (ok && opErr.Op != "accept") {
return err