mirror of
https://github.com/pushbits/server.git
synced 2025-06-10 06:32:03 +02:00
Merge remote-tracking branch 'origin/main' into alertmanager-interface
This commit is contained in:
commit
d1c62e24ed
26 changed files with 301 additions and 107 deletions
|
@ -1,7 +1,8 @@
|
|||
package router
|
||||
|
||||
import (
|
||||
"log"
|
||||
"github.com/gin-contrib/location"
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
"github.com/pushbits/server/internal/api"
|
||||
"github.com/pushbits/server/internal/api/alertmanager"
|
||||
|
@ -10,14 +11,12 @@ import (
|
|||
"github.com/pushbits/server/internal/configuration"
|
||||
"github.com/pushbits/server/internal/database"
|
||||
"github.com/pushbits/server/internal/dispatcher"
|
||||
|
||||
"github.com/gin-contrib/location"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/pushbits/server/internal/log"
|
||||
)
|
||||
|
||||
// Create a Gin engine and setup all routes.
|
||||
func Create(debug bool, cm *credentials.Manager, db *database.Database, dp *dispatcher.Dispatcher, alertmanagerConfig *configuration.Alertmanager) *gin.Engine {
|
||||
log.Println("Setting up HTTP routes.")
|
||||
log.L.Println("Setting up HTTP routes.")
|
||||
|
||||
if !debug {
|
||||
gin.SetMode(gin.ReleaseMode)
|
||||
|
@ -34,7 +33,8 @@ func Create(debug bool, cm *credentials.Manager, db *database.Database, dp *disp
|
|||
MessageAnnotation: alertmanagerConfig.AnnotationMessage,
|
||||
}}
|
||||
|
||||
r := gin.Default()
|
||||
r := gin.New()
|
||||
r.Use(log.GinLogger(log.L), gin.Recovery())
|
||||
|
||||
r.Use(location.Default())
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue