mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-16 21:56:40 -05:00
26 lines
457 B
Go
26 lines
457 B
Go
package caddycmd
|
|
|
|
import (
|
|
"flag"
|
|
"log"
|
|
|
|
"github.com/caddyserver/caddy2"
|
|
)
|
|
|
|
// Main executes the main function of the caddy command.
|
|
func Main() {
|
|
flag.Parse()
|
|
|
|
err := caddy2.StartAdmin(*listenAddr)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
defer caddy2.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")
|