macaron.go
func (m *Macaron) Run(args ...interface{}) {
	host, port := GetDefaultListenInfo()
	if len(args) == 1 {
		switch arg := args[0].(type) {
		case string:
			host = arg
		case int:
			port = arg
		}
	} else if len(args) >= 2 {
		if arg, ok := args[0].(string); ok {
			host = arg
		}
		if arg, ok := args[1].(int); ok {
			port = arg
		}
	}

	addr := host + ":" + com.ToStr(port)
	logger := m.GetVal(reflect.TypeOf(m.logger)).Interface().(*log.Logger)
	logger.Printf("listening on %s (%s)\n", addr, safeEnv())
	logger.Fatalln(http.ListenAndServe(addr, m))
}
func (m *Macaron) Run(args ...interface{}) {
	host, port := GetDefaultListenInfo()
	if len(args) == 1 {
		switch arg := args[0].(type) {
		case string:
			host = arg
		case int:
			port = arg
		}
	} else if len(args) >= 2 {
		if arg, ok := args[0].(string); ok {
			host = arg
		}
		if arg, ok := args[1].(int); ok {
			port = arg
		}
	}

	addr := host + ":" + com.ToStr(port)
	logger := m.GetVal(reflect.TypeOf(m.logger)).Interface().(*log.Logger)
	logger.Printf("listening on %s (%s)\n", addr, safeEnv())
	logger.Fatalln(http.ListenAndServe(addr, m))
}
func ( m * Macaron ) Run ( args ... interface { } ) { host , port := GetDefaultListenInfo ( ) if len ( args ) == 1 { switch arg := args [ 0 ] . ( type ) { case string : host = arg case int : port = arg } } else if len ( args ) >= 2 { if arg , ok := args [ 0 ] . ( string ) ; ok { host = arg } if arg , ok := args [ 1 ] . ( int ) ; ok { port = arg } } addr := host + " " + com . ToStr ( port ) logger := m . GetVal ( reflect . TypeOf ( m . logger ) ) . Interface ( ) . ( * log . Logger ) logger . Printf ( " \n " , addr , safeEnv ( ) ) logger . Fatalln ( http . ListenAndServe ( addr , m ) ) }
// Run the http server. Listening on os.GetEnv("PORT") or 4000 by default.
Run the http server . Listening on os . GetEnv ( PORT ) or 4000 by default .