mirror of
https://github.com/caddyserver/caddy.git
synced 2024-11-23 01:40:09 +08:00
5137859e47
Removes the version from the package name
27 lines
454 B
Go
27 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")
|