asp.net core 5.0,怎么山寨了koa2?
5.0提出了一个中间件的概念。实现思想跟koa一样。
app.Use(async (context, next) =>
{
// Do work that doesn't write to the Response.
await next.Invoke();
// Do logging or other work that doesn't write to the Response.
});
app.Run(async context =>
{
await context.Response.WriteAsync("Hello from 2nd delegate.");
});


浙公网安备 33010602011771号