mirror of https://github.com/gofiber/fiber.git
✨Listener replaces Serve
parent
29c47030fe
commit
599fdcdcb6
10
app.go
10
app.go
|
@ -415,11 +415,17 @@ func (app *App) Routes() []*Route {
|
|||
return routes
|
||||
}
|
||||
|
||||
// Serve can be used to pass a custom listener
|
||||
// Serve is deprecated, please use app.Listener()
|
||||
func (app *App) Serve(ln net.Listener, tlsconfig ...*tls.Config) error {
|
||||
fmt.Println("serve: app.Serve() is deprecated since v1.12.5, please use app.Listener()")
|
||||
return app.Listener(ln, tlsconfig...)
|
||||
}
|
||||
|
||||
// Listener can be used to pass a custom listener
|
||||
// This method does not support the Prefork feature
|
||||
// Prefork is not supported using app.Serve(ln net.Listener)
|
||||
// You can pass an optional *tls.Config to enable TLS.
|
||||
func (app *App) Serve(ln net.Listener, tlsconfig ...*tls.Config) error {
|
||||
func (app *App) Listener(ln net.Listener, tlsconfig ...*tls.Config) error {
|
||||
// Update fiber server settings
|
||||
app.init()
|
||||
// TLS config
|
||||
|
|
Loading…
Reference in New Issue