mirror of
https://github.com/kataras/iris.git
synced 2025-12-22 04:17:03 +00:00
Modification
- Add configurator for Party - Modification for CORS middleware example Former-commit-id: f01c01d4eac41666a92890461851909a6ade018b
This commit is contained in:
@@ -114,6 +114,14 @@ func NewAPIBuilder() *APIBuilder {
|
||||
return api
|
||||
}
|
||||
|
||||
// ConfigureParty configures this party like `iris.Application#Configure`
|
||||
// That allows middlewares focused on the Party like CORS middleware
|
||||
func (api *APIBuilder) ConfigureParty(conf ...PartyConfigurator) {
|
||||
for _, h := range conf {
|
||||
h(api)
|
||||
}
|
||||
}
|
||||
|
||||
// GetRelPath returns the current party's relative path.
|
||||
// i.e:
|
||||
// if r := app.Party("/users"), then the `r.GetRelPath()` is the "/users".
|
||||
|
||||
Reference in New Issue
Block a user