친구 초대 및 관리 완료
This commit is contained in:
13
main.go
13
main.go
@ -1,4 +1,3 @@
|
||||
// warroom project main.go
|
||||
package main
|
||||
|
||||
import (
|
||||
@ -7,7 +6,7 @@ import (
|
||||
|
||||
"repositories.action2quare.com/ayo/gocommon/flagx"
|
||||
"repositories.action2quare.com/ayo/gocommon/wshandler"
|
||||
"repositories.action2quare.com/ayo/tavern/core"
|
||||
"repositories.action2quare.com/ayo/social/core"
|
||||
|
||||
"repositories.action2quare.com/ayo/gocommon"
|
||||
"repositories.action2quare.com/ayo/gocommon/logger"
|
||||
@ -20,7 +19,7 @@ func main() {
|
||||
flagx.Parse()
|
||||
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
var config core.TavernConfig
|
||||
var config core.SocialConfig
|
||||
if err := gocommon.LoadConfig(&config); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@ -35,18 +34,18 @@ func main() {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
if tv, err := core.New(ctx, wsh); err != nil {
|
||||
if so, err := core.New(ctx, wsh, &config); err != nil {
|
||||
panic(err)
|
||||
} else {
|
||||
serveMux := http.NewServeMux()
|
||||
wsh.RegisterHandlers(serveMux, *prefix)
|
||||
tv.RegisterHandlers(ctx, serveMux, *prefix)
|
||||
so.RegisterHandlers(ctx, serveMux, *prefix)
|
||||
server := gocommon.NewHTTPServer(serveMux)
|
||||
logger.Println("tavern is started")
|
||||
logger.Println("social is started")
|
||||
wsh.Start(ctx)
|
||||
server.Start()
|
||||
cancel()
|
||||
tv.Cleanup()
|
||||
so.Cleanup()
|
||||
wsh.Cleanup()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user