mobile-api-example/main.go
2026-01-03 15:25:31 +03:00

32 lines
643 B
Go

package main
import (
_ "mobile-api-example/docs"
"mobile-api-example/src/auth"
"mobile-api-example/src/config"
"mobile-api-example/src/server"
"mobile-api-example/src/storage"
)
// @Title Mobile Example API
// @Version 1.0.0
// @BasePath /api
// @securityDefinitions.apikey ApiKeyAuth
// @In header
// @Name Authorization
// @Description Введите "token" для аутентификации
func main() {
c := config.NewConfig()
db, err := storage.Connect()
if err != nil {
panic(err)
}
defer db.Close()
srv := server.NewServer()
auth.NewHandler(db, srv.BaseGroup)
srv.Run(c.Address)
}