1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-17 18:07:01 +00:00

minor improvement of the previous commit

This commit is contained in:
Gerasimos (Makis) Maropoulos
2021-02-17 16:57:19 +02:00
parent cbf70a7bcf
commit f34703e3cf
3 changed files with 10 additions and 4 deletions

View File

@@ -870,8 +870,14 @@ type PartyConfigurator interface {
// router.Get("/{id:uuid}", api.getUser)
// [...]
// }
func (api *APIBuilder) PartyConfigure(relativePath string, partyReg PartyConfigurator) Party {
return api.PartyFunc(relativePath, partyReg.Configure)
func (api *APIBuilder) PartyConfigure(relativePath string, partyReg ...PartyConfigurator) Party {
child := api.Party(relativePath)
for _, p := range partyReg {
if p != nil {
p.Configure(child)
}
}
return child
}
// Subdomain returns a new party which is responsible to register routes to