This commit is contained in:
Kar
2024-01-08 14:00:41 +05:30
commit dbe86acfac
31 changed files with 1793 additions and 0 deletions

31
main.go Normal file
View File

@@ -0,0 +1,31 @@
package main
import (
"gitlab.com/arkadooti.sarkar/go-boilerplate/core/appcontext"
"gitlab.com/arkadooti.sarkar/go-boilerplate/core/log"
"gitlab.com/arkadooti.sarkar/go-boilerplate/core/mongomanager"
"gitlab.com/arkadooti.sarkar/go-boilerplate/db/mongo"
"gitlab.com/arkadooti.sarkar/go-boilerplate/domain/standard"
"gitlab.com/arkadooti.sarkar/go-boilerplate/webService"
"os"
)
const servicePort = "4100"
const serviceRoute = "/boilerplate"
func main() {
ctx := appcontext.New()
mongoClient, err := mongomanager.NewMongoClient(os.Getenv("MongoHost"), "myapp")
if err != nil {
log.GenericError(ctx, err)
}
mongoService := mongo.NewMongoService(mongoClient)
domain := standard.NewDomainService(mongoService)
newService := webService.NewWebService(domain, mongoService, serviceRoute, servicePort)
newService.Run(ctx)
}