This commit is contained in:
kandrusyak
2023-07-16 23:31:57 +03:00
parent 454c9bc82e
commit 2916a50336
8 changed files with 226 additions and 7 deletions

14
main.go
View File

@@ -2,10 +2,12 @@ package main
import (
"astra-events/config"
_ "astra-events/docs"
"astra-events/handler"
"astra-events/model"
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
"github.com/swaggo/echo-swagger"
"gorm.io/driver/postgres"
"gorm.io/gorm"
"gorm.io/gorm/logger"
@@ -14,6 +16,16 @@ import (
"time"
)
// @title Astra Events
// @version 1.0
// @description This is an astra-events service.
// @contact.name Kirill Andrusyak
// @contact.email andrusyakka@dopcore.com
// @host api.astra.dev.dop
// @BasePath /events
func main() {
newLogger := logger.New(
log.New(os.Stdout, "\r\n", log.LstdFlags), // io writer
@@ -47,5 +59,7 @@ func main() {
e.GET("/health", handler.Health)
e.GET("/swagger/*", echoSwagger.WrapHandler)
e.Logger.Fatal(e.Start(":" + config.Env.Server.Port))
}