Skip to content

Commit

Permalink
add default override for bind address
Browse files Browse the repository at this point in the history
  • Loading branch information
nilslice committed Jul 23, 2017
1 parent 9ea0ec0 commit f48dee8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/ponzu/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ var ErrWrongOrMissingService = errors.New("To execute 'ponzu serve', " +
var serveCmd = &cobra.Command{
Use: "serve [flags] <service,service>",
Aliases: []string{"s"},
Short: "actually run the server (serve is wrapped by the run command)",
Short: "run the server (serve is wrapped by the run command)",
Hidden: true,
RunE: func(cmd *cobra.Command, args []string) error {
if len(args) == 0 {
Expand Down Expand Up @@ -191,6 +191,9 @@ var serveCmd = &cobra.Command{

// save the bound address the system is listening on so internal system can make
// HTTP api calls while in dev or production w/o adding more cli flags
if bind == "" {
bind = "localhost"
}
err = db.PutConfig("bind_addr", bind)
if err != nil {
log.Fatalln("System failed to save config. Please try to run again.", err)
Expand Down

0 comments on commit f48dee8

Please sign in to comment.