Reorganize & move ctrls under route groups
This commit is contained in:
parent
ff54adac97
commit
0ab59c791b
@ -23,7 +23,8 @@ func MountRoutes(r chi.Router) {
|
||||
|
||||
// Initialize handlers & controllers.
|
||||
r.Group(func(r chi.Router) {
|
||||
handlers.NewPermissions(Permissions{}.New()).MountRoutes(r)
|
||||
// Use alternative handlers that support file serving
|
||||
handlers.NewAttachment(attachment).MountRoutes(r)
|
||||
})
|
||||
|
||||
// Protect all _private_ routes
|
||||
@ -37,11 +38,9 @@ func MountRoutes(r chi.Router) {
|
||||
handlers.NewRecord(record).MountRoutes(r)
|
||||
handlers.NewChart(chart).MountRoutes(r)
|
||||
handlers.NewNotification(notification).MountRoutes(r)
|
||||
handlers.NewPermissions(Permissions{}.New()).MountRoutes(r)
|
||||
|
||||
handlers.NewAutomationScript(automationScript).MountRoutes(r)
|
||||
handlers.NewAutomationTrigger(automationTrgger).MountRoutes(r)
|
||||
})
|
||||
|
||||
// Use alternative handlers that support file serving
|
||||
handlers.NewAttachment(attachment).MountRoutes(r)
|
||||
}
|
||||
|
||||
@ -12,7 +12,6 @@ func MountRoutes(r chi.Router) {
|
||||
r.Group(func(r chi.Router) {
|
||||
handlers.NewAttachment(Attachment{}.New()).MountRoutes(r)
|
||||
handlers.NewWebhooksPublic(WebhooksPublic{}.New()).MountRoutes(r)
|
||||
handlers.NewPermissions(Permissions{}.New()).MountRoutes(r)
|
||||
})
|
||||
|
||||
// Protect all _private_ routes
|
||||
@ -27,5 +26,6 @@ func MountRoutes(r chi.Router) {
|
||||
handlers.NewStatus(Status{}.New()).MountRoutes(r)
|
||||
handlers.NewCommands(Commands{}.New()).MountRoutes(r)
|
||||
handlers.NewWebhooks(Webhooks{}.New()).MountRoutes(r)
|
||||
handlers.NewPermissions(Permissions{}.New()).MountRoutes(r)
|
||||
})
|
||||
}
|
||||
|
||||
@ -10,10 +10,10 @@ import (
|
||||
func MountRoutes(r chi.Router) {
|
||||
NewExternalAuth().ApiServerRoutes(r)
|
||||
|
||||
// Provide raw `/auth` handlers
|
||||
handlers.NewAuth((Auth{}).New()).MountRoutes(r)
|
||||
|
||||
handlers.NewAuthInternal((AuthInternal{}).New()).MountRoutes(r)
|
||||
r.Group(func(r chi.Router) {
|
||||
handlers.NewAuth((Auth{}).New()).MountRoutes(r)
|
||||
handlers.NewAuthInternal((AuthInternal{}).New()).MountRoutes(r)
|
||||
})
|
||||
|
||||
// Protect all _private_ routes
|
||||
r.Group(func(r chi.Router) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user