28 lines
613 B
Go
28 lines
613 B
Go
package main
|
|
|
|
import (
|
|
"brainbuffer/pkg/brainbuffer/infrastructure"
|
|
database2 "brainbuffer/pkg/brainbuffer/infrastructure/database"
|
|
appserver "brainbuffer/pkg/brainbuffer/infrastructure/server"
|
|
"github.com/rs/zerolog"
|
|
"github.com/rs/zerolog/log"
|
|
"os"
|
|
)
|
|
|
|
func main() {
|
|
configureLogger()
|
|
|
|
conf := infrastructure.NewConfig()
|
|
|
|
pool := database2.NewPool(conf)
|
|
database2.Migrate(pool)
|
|
|
|
context := infrastructure.NewContext(pool, conf)
|
|
server := appserver.New(context)
|
|
|
|
server.Logger.Fatal(server.Start(":8080"))
|
|
}
|
|
|
|
func configureLogger() {
|
|
log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stderr})
|
|
}
|