Check a passed listen address first.
This commit is contained in:
parent
760d08dcde
commit
b793da40d4
@ -30,11 +30,6 @@ func main() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
hand := handlers.New(directoryPath, web.Assets(), !*enableFileHandler)
|
|
||||||
srv := server.NewHttpServer()
|
|
||||||
|
|
||||||
srv.GET("/*filepath", hand.Index)
|
|
||||||
|
|
||||||
var network string
|
var network string
|
||||||
if !strings.ContainsRune(*listenAddress, ':') {
|
if !strings.ContainsRune(*listenAddress, ':') {
|
||||||
network = "unix"
|
network = "unix"
|
||||||
@ -52,6 +47,11 @@ func main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hand := handlers.New(directoryPath, web.Assets(), !*enableFileHandler)
|
||||||
|
srv := server.NewHttpServer()
|
||||||
|
|
||||||
|
srv.GET("/*filepath", hand.Index)
|
||||||
|
|
||||||
if err := srv.Start(network, *listenAddress); err != nil {
|
if err := srv.Start(network, *listenAddress); err != nil {
|
||||||
log.Fatalln(err)
|
log.Fatalln(err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user