You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
454 B
26 lines
454 B
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")
|
|
|