Start stars HTTP server on given address with Echo as a handler serving requests. The server can be shutdown by sending os.Interrupt signal with `ctrl+c`. Method returns only errors that are not http.ErrServerClosed. Note: this method is created for use in examples/demos and is deliberately simple
(address string)
| 811 | // slog.Error(err.Error()) |
| 812 | // } |
| 813 | func (e *Echo) Start(address string) error { |
| 814 | sc := StartConfig{Address: address} |
| 815 | ctx, cancel := signal.NotifyContext(stdContext.Background(), os.Interrupt, syscall.SIGTERM) // start shutdown process on ctrl+c |
| 816 | defer cancel() |
| 817 | return sc.Start(ctx, e) |
| 818 | } |
| 819 | |
| 820 | // WrapHandler wraps `http.Handler` into `echo.HandlerFunc`. |
| 821 | func WrapHandler(h http.Handler) HandlerFunc { |