pnyx/cmd/server/main.go

29 lines
374 B
Go

2024-04-03 18:52:04 -06:00
package main
import (
"os"
"os/signal"
"syscall"
"git.metznet.ca/MetzNet/pnyx"
)
func main() {
os_sigs := make(chan os.Signal, 1)
signal.Notify(os_sigs, syscall.SIGINT, syscall.SIGINT)
server := pnyx.NewServer()
err := server.Start(os.Args[1])
if err != nil {
panic(err)
}
<-os_sigs
err = server.Stop()
if err != nil {
panic(err)
}
}