server.go
func Run() {
	for _, f := range beforeRun {
		f()
	}

	// parse command line params.
	if OpenCommandLine {
		flag.StringVar(&Address, "address", ":8080", "-address=:8080")
		flag.BoolVar(&Production, "production", false, "-production=false")
		flag.Parse()
	}

	log.Warnln(fmt.Sprintf("Serving %s with pid %d. Production is %t.", Address, os.Getpid(), Production))

	// set default router.
	Use(Routers.handlers)

	// set graceful server.
	srv := &graceful.Server{
		ListenLimit: ListenLimit,
		ConnState: func(conn net.Conn, state http.ConnState) {
			// conn has a new state
		},
		Server: &http.Server{
			Addr:           Address,
			Handler:        defaultHandlersStack,
			ReadTimeout:    ReadTimeout,
			WriteTimeout:   WriteTimeout,
			IdleTimeout:    IdleTimeout,
			MaxHeaderBytes: MaxHeaderBytes,
		},
	}
	err := srv.ListenAndServe()

	if err != nil {
		log.Fatalln(err)
	}
	log.Warnln("Server stoped.")

}
func Run() {
	for _, f := range beforeRun {
		f()
	}

	// parse command line params.
	if OpenCommandLine {
		flag.StringVar(&Address, "address", ":8080", "-address=:8080")
		flag.BoolVar(&Production, "production", false, "-production=false")
		flag.Parse()
	}

	log.Warnln(fmt.Sprintf("Serving %s with pid %d. Production is %t.", Address, os.Getpid(), Production))

	// set default router.
	Use(Routers.handlers)

	// set graceful server.
	srv := &graceful.Server{
		ListenLimit: ListenLimit,
		ConnState: func(conn net.Conn, state http.ConnState) {
			// conn has a new state
		},
		Server: &http.Server{
			Addr:           Address,
			Handler:        defaultHandlersStack,
			ReadTimeout:    ReadTimeout,
			WriteTimeout:   WriteTimeout,
			IdleTimeout:    IdleTimeout,
			MaxHeaderBytes: MaxHeaderBytes,
		},
	}
	err := srv.ListenAndServe()

	if err != nil {
		log.Fatalln(err)
	}
	log.Warnln("Server stoped.")

}
// Run starts the server for listening and serving.