main.go 418 B

123456789101112131415161718192021
  1. package main
  2. import (
  3. "github.com/e421083458/golang_common/lib"
  4. "github.com/go_gateway_admin/router"
  5. "os"
  6. "os/signal"
  7. "syscall"
  8. )
  9. func main() {
  10. lib.InitModule("./conf/dev/", []string{"base", "mysql", "redis"})
  11. defer lib.Destroy()
  12. router.HttpServerRun()
  13. quit := make(chan os.Signal)
  14. signal.Notify(quit, syscall.SIGKILL, syscall.SIGQUIT, syscall.SIGINT, syscall.SIGTERM)
  15. <-quit
  16. router.HttpServerStop()
  17. }