init
This commit is contained in:
31
main.go
Normal file
31
main.go
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user