mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-21 00:11:42 +02:00
go-proxy ls-route now query api server first, then fallback to read from config file
This commit is contained in:
@@ -91,7 +91,14 @@ func main() {
|
||||
printJSON(cfg.Value())
|
||||
return
|
||||
case common.CommandListRoutes:
|
||||
printJSON(cfg.RoutesByAlias())
|
||||
routes, err := apiUtils.ListRoutes()
|
||||
if err.HasError() {
|
||||
log.Printf("failed to connect to api server: %s", err)
|
||||
log.Printf("falling back to config file")
|
||||
printJSON(cfg.RoutesByAlias())
|
||||
} else {
|
||||
printJSON(routes)
|
||||
}
|
||||
return
|
||||
case common.CommandDebugListEntries:
|
||||
printJSON(cfg.DumpEntries())
|
||||
|
||||
Reference in New Issue
Block a user