add config

This commit is contained in:
Fran Jurmanović
2024-09-30 23:08:06 +02:00
parent 86804e04d2
commit f5a7749ad9
9 changed files with 79 additions and 27 deletions

View File

@@ -1,26 +1,26 @@
package main
import (
"log"
"rockhu-bot/local/api"
cronhu "rockhu-bot/local/utl/cron"
"rockhu-bot/local/utl/db"
discordrhu "rockhu-bot/local/utl/discord"
"rockhu-bot/local/utl/server"
"github.com/joho/godotenv"
"github.com/robfig/cron/v3"
"go.uber.org/dig"
)
func main() {
godotenv.Load()
err := godotenv.Load()
if err != nil {
log.Fatal("error loading .env file")
}
di := dig.New()
c := cron.New()
di.Provide(func() *cron.Cron {
return c
})
cronhu.Init(di)
discordrhu.Init(di)
db.Start(di)
server := server.Start(di)