ChFootMain.go 659 B

12345678910111213141516171819202122232425262728293031323334
  1. package main
  2. import (
  3. "chathub/chfoot/core"
  4. "chathub/chfoot/http"
  5. "flag"
  6. "fmt"
  7. "github.com/etlibgo/et"
  8. "time"
  9. )
  10. func main() {
  11. fmt.Println("foot began")
  12. fmt.Println(et.StrPadLeft("et pad left", "0", 20))
  13. pStrCfgPath := flag.String("cfgpath", "foot-cfg/foot_main.cfg", "see foot-cfg")
  14. flag.Parse()
  15. strCfgContent := et.FileReadStr(*pStrCfgPath)
  16. pJsonCfg := et.ExJsonFromStr(strCfgContent)
  17. core.AppInit(pJsonCfg)
  18. http.FootHttpEntry(core.AppGetHttpServer())
  19. fmt.Println("cfg get name:" + core.CfgGetStr("name"))
  20. core.AppStart()
  21. for core.AppIsRunning() {
  22. time.Sleep(time.Duration(100) * time.Millisecond)
  23. }
  24. fmt.Println("foot ended")
  25. }