Exploring the potential of middleware
There are many other things you can do with middleware. For example, did you know that you can split the request pipeline into two or more pipelines? We'll look at how to do that and several other things in this section.
Branching the pipeline with /map
The next code snippet shows how to create branches of the request pipeline based on specific paths:
app.Map("/map1", app1 => { // some more Middleware app1.Run(async context => { await context.Response.WriteAsync("Map Test 1"); }); }); app.Map("/map2", app2 => { // some more Middleware app2.Run(async context => { await context.Response.WriteAsync("Map Test 2"); ...