swagger
This commit is contained in:
14
main.go
14
main.go
@@ -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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user