Support separate database for testing.
This commit is contained in:
parent
4e2f186dad
commit
60dedc0944
5 changed files with 65 additions and 34 deletions
11
main.go
11
main.go
|
|
@ -8,24 +8,13 @@ import (
|
|||
"os/signal"
|
||||
"time"
|
||||
|
||||
"goweb/config"
|
||||
"goweb/container"
|
||||
"goweb/controllers"
|
||||
|
||||
"github.com/labstack/gommon/log"
|
||||
)
|
||||
|
||||
func main() {
|
||||
c := container.NewContainer()
|
||||
|
||||
// Configure logging
|
||||
switch c.Config.App.Environment {
|
||||
case config.EnvProduction:
|
||||
c.Web.Logger.SetLevel(log.WARN)
|
||||
default:
|
||||
c.Web.Logger.SetLevel(log.DEBUG)
|
||||
}
|
||||
|
||||
// Build the router
|
||||
controllers.BuildRouter(c)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue