blob: 703e11910f725b62d171bbf8a9b48ba48a1c0860 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
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")
|