Files
fx-serverless/handlers/list_infra.go
Minghe c0009b1b64 request a port when not port given (#379)
* request a port when not port given
* make context an interface, for easy testing (#380)
2019-12-03 15:14:13 +08:00

20 lines
329 B
Go

package handlers
import (
"fmt"
"github.com/metrue/fx/config"
"github.com/metrue/fx/context"
)
// ListInfra list infra
func ListInfra(ctx context.Contexter) (err error) {
fxConfig := ctx.Get("config").(*config.Config)
conf, err := fxConfig.View()
if err != nil {
return err
}
fmt.Println(string(conf))
return nil
}