Skip to content

Commit

Permalink
fix: change BasicAuth to Bearer
Browse files Browse the repository at this point in the history
  • Loading branch information
Wer1d committed Dec 26, 2023
1 parent 5ff54fb commit 35279b1
Show file tree
Hide file tree
Showing 10 changed files with 358 additions and 172 deletions.
19 changes: 12 additions & 7 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@ import (
ginSwagger "github.com/swaggo/gin-swagger"
)

// @title OPH-66 Backend API
// @version 1.0
// @description This is a sample server celler server.
// @securityDefinitions.basic BasicAuth
// @Schemes http https
// @title OPH-66 Backend API
// @version 1.0
// @description Documentation outlines the specifications and endpoints for the OPH-66 Backend API.
// @Schemes http https
// @securityDefinitions.apikey Bearer
// @in header
// @name Authorization
// @description Type "Bearer" followed by a space and JWT token.
func main() {
container, err := di.Init()
if err != nil {
Expand All @@ -26,13 +29,15 @@ func main() {
gin.SetMode(gin.ReleaseMode)
}
r := gin.Default()

r.GET("/_hc", container.HcHandler.HealthCheck)
r.GET("/live", container.FeatureflagHandler.GetLivestreamInfo)
r.GET("/events", container.EventHandler.GetAllEvents)
r.GET("/events/:eventId", container.EventHandler.GetEventById)
r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))

fmt.Println(container.Config.AppConfig.Port)
if container.Config.AppConfig.Env == "development" {
r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
}
if err := r.Run(fmt.Sprintf(":%v", container.Config.AppConfig.Port)); err != nil {
container.Logger.Fatal("unable to start server")
}
Expand Down
Loading

0 comments on commit 35279b1

Please sign in to comment.