func main() { if len(os.Args) < 2 { fmt.Println(usage) os.Exit(1) } args, _ := docopt.Parse(usage, nil, true, version, false) if os.Getenv("GO_ENV") != "production" { err := godotenv.Load() if err != nil { fmt.Println("warning: no .env file. continuing in development environment...") } } if args["-s"] != false || args["-p"] != false { var port string if args["<port>"] != nil { port = args["<port>"].(string) } else if os.Getenv("PORT") != "" { port = os.Getenv("PORT") } else { fmt.Println("stap, doge port not set in env or argument.") os.Exit(1) } serveTwiML(port) } }
func init() { godotenv.Load() }