caddy/cmd/run.go
Matthew Holt 5137859e47 Rename caddy2 -> caddy
Removes the version from the package name
2019-06-14 11:58:28 -06:00

26 lines
454 B
Go

package caddycmd
import (
"flag"
"log"
"github.com/caddyserver/caddy"
)
// Main executes the main function of the caddy command.
func Main() {
flag.Parse()
err := caddy.StartAdmin(*listenAddr)
if err != nil {
log.Fatal(err)
}
defer caddy.StopAdmin()
log.Println("Caddy 2 admin endpoint listening on", *listenAddr)
select {}
}
// TODO: for dev only
var listenAddr = flag.String("listen", ":1234", "The admin endpoint listener address")