framework_v2/internal/routes/router.go

36 lines
956 B
Go
Raw Normal View History

2024-07-14 10:29:36 +00:00
package routes
2024-07-14 09:44:49 +00:00
import (
"framework_v2/internal/handlers/controllers/user"
"framework_v2/internal/middleware/http"
"framework_v2/internal/providers"
"github.com/gin-gonic/gin"
)
2024-07-14 14:14:27 +00:00
// @title Swagger Example API
// @version 1.0
// @description This is a sample server celler server.
// @termsOfService http://swagger.io/terms/
// @contact.name API Support
// @contact.url http://www.swagger.io/support
// @contact.email support@swagger.io
// @license.name Apache 2.0
// @license.url http://www.apache.org/licenses/LICENSE-2.0.html
// @host localhost:8080
// @BasePath /api/v1
// @securityDefinitions.basic BasicAuth
// @securityDefinitions.apikey ApiKeyAuth
// @in header
// @name Authorization
// @description Description for what is this security definition being used
2024-07-14 09:44:49 +00:00
func InitApiRoutes() {
var router = *providers.MustGet[gin.Engine]()
2024-07-14 10:14:01 +00:00
router.GET("/", http.MiddlewareJSONResponse, http.RequireJWTIDToken, user.CurrentUser)
2024-07-14 09:44:49 +00:00
}