mirror of
https://github.com/caddyserver/caddy.git
synced 2025-05-31 16:33:15 +08:00
core: Simplify Server initializer
This commit is contained in:
@ -29,7 +29,12 @@ type Server struct {
|
||||
// New creates a new Server which will bind to addr and serve
|
||||
// the sites/hosts configured in configs. This function does
|
||||
// not start serving.
|
||||
func New(addr string, configs []Config, tls bool) (*Server, error) {
|
||||
func New(addr string, configs []Config) (*Server, error) {
|
||||
var tls bool
|
||||
if len(configs) > 0 {
|
||||
tls = configs[0].TLS.Enabled
|
||||
}
|
||||
|
||||
s := &Server{
|
||||
address: addr,
|
||||
tls: tls,
|
||||
|
Reference in New Issue
Block a user