|
@ -7,13 +7,14 @@ import ( |
|
|
"git.aiterp.net/lucifer/new-server/app/config" |
|
|
"git.aiterp.net/lucifer/new-server/app/config" |
|
|
"git.aiterp.net/lucifer/new-server/app/services" |
|
|
"git.aiterp.net/lucifer/new-server/app/services" |
|
|
"git.aiterp.net/lucifer/new-server/app/services/publisher" |
|
|
"git.aiterp.net/lucifer/new-server/app/services/publisher" |
|
|
|
|
|
"git.aiterp.net/lucifer/new-server/models" |
|
|
"github.com/gin-gonic/gin" |
|
|
"github.com/gin-gonic/gin" |
|
|
"log" |
|
|
"log" |
|
|
"time" |
|
|
"time" |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
func StartServer() { |
|
|
func StartServer() { |
|
|
setupCtx, cancel := context.WithTimeout(context.Background(), time.Second * 10) |
|
|
|
|
|
|
|
|
setupCtx, cancel := context.WithTimeout(context.Background(), time.Second*10) |
|
|
defer cancel() |
|
|
defer cancel() |
|
|
|
|
|
|
|
|
err := publisher.Initialize(setupCtx) |
|
|
err := publisher.Initialize(setupCtx) |
|
@ -38,5 +39,7 @@ func StartServer() { |
|
|
api.EventHandlers(apiGin.Group("/event-handlers")) |
|
|
api.EventHandlers(apiGin.Group("/event-handlers")) |
|
|
api.Scenes(apiGin.Group("/scenes")) |
|
|
api.Scenes(apiGin.Group("/scenes")) |
|
|
|
|
|
|
|
|
|
|
|
models.TimeOfDayTimeZone = config.Location() |
|
|
|
|
|
|
|
|
log.Fatal(ginny.Run(fmt.Sprintf("0.0.0.0:%d", config.ServerPort()))) |
|
|
log.Fatal(ginny.Run(fmt.Sprintf("0.0.0.0:%d", config.ServerPort()))) |
|
|
} |
|
|
} |