Listener replaces Serve

pull/546/head
Fenny 2020-07-05 11:08:23 +02:00
parent 29c47030fe
commit 599fdcdcb6
1 changed files with 8 additions and 2 deletions

10
app.go
View File

@ -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