server defaults to localhost unless overridden by command line flags

This commit is contained in:
spf13 2013-10-04 16:03:13 -04:00
parent 266f583a8c
commit be7ba0e98f

View file

@ -40,7 +40,8 @@ Serve them up.`,
func server(cmd *cobra.Command, args []string) {
InitializeConfig()
if Config.BaseUrl == "" {
// Unless command line overrides, we use localhost for the server
if BaseUrl == "" {
Config.BaseUrl = "http://localhost:" + strconv.Itoa(serverPort)
}