Files
fx-serverless/handlers/use_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

14 lines
279 B
Go

package handlers
import (
"github.com/metrue/fx/config"
"github.com/metrue/fx/context"
)
// UseInfra use infra
func UseInfra(ctx context.Contexter) error {
fxConfig := ctx.Get("config").(*config.Config)
cli := ctx.GetCliContext()
return fxConfig.Use(cli.Args().First())
}