mirror of
https://github.com/kataras/iris.git
synced 2025-12-18 18:37:05 +00:00
new 'Party.DI()' method to return the Party's instance of the new 'APIBuilderDI' and move the DI-relative Router to this new APIBuilderDI
Former-commit-id: 2fb81406c6e3162991c90e0918a3cac1b77c2b54
This commit is contained in:
@@ -22,6 +22,6 @@ func handler(id int, in testInput) testOutput {
|
||||
|
||||
func main() {
|
||||
app := iris.New()
|
||||
app.HandleFunc(iris.MethodPost, "/{id:int}", handler)
|
||||
app.DI().Post("/{id:int}", handler)
|
||||
app.Listen(":8080")
|
||||
}
|
||||
|
||||
@@ -46,8 +46,11 @@ func newApp() *iris.Application {
|
||||
// a JSON and 200 status code
|
||||
// or 202 status code and empty body
|
||||
// or a 409 status code and "my_error" body.
|
||||
app.UseFunc(middleware)
|
||||
app.HandleFunc(iris.MethodPost, "/{id:int}", handler)
|
||||
di := app.DI()
|
||||
{
|
||||
di.Use(middleware)
|
||||
di.Post("/{id:int}", handler)
|
||||
}
|
||||
|
||||
app.Configure(
|
||||
iris.WithOptimizations, /* optional */
|
||||
|
||||
Reference in New Issue
Block a user