Last active
November 7, 2019 03:15
-
-
Save manakuro/9bd58bbceb95d8d8a41221e4c86ae542 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"log" | |
_ "github.com/jinzhu/gorm/dialects/mysql" | |
"github.com/labstack/echo" | |
"github.com/manakuro/golang-clean-architecture/config" | |
"github.com/manakuro/golang-clean-architecture/infrastructure/datastore" | |
"github.com/manakuro/golang-clean-architecture/infrastructure/router" | |
"github.com/manakuro/golang-clean-architecture/registry" | |
) | |
func main() { | |
config.ReadConfig() | |
db := datastore.NewDB() | |
db.LogMode(true) | |
defer db.Close() | |
r := registry.NewRegistry(db) | |
e := echo.New() | |
e = router.NewRouter(e, r.NewAppController()) | |
fmt.Println("Server listen at http://localhost" + ":" + config.C.Server.Address) | |
if err := e.Start(":" + config.C.Server.Address); err != nil { | |
log.Fatalln(err) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment