Makes the dev file built more gulp-ish way
This commit is contained in:
3
main.go
3
main.go
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user