Skip to content

Instantly share code, notes, and snippets.

@damianh
Last active August 29, 2015 14:03
Show Gist options
  • Select an option

  • Save damianh/4b6e3e65250494197ca6 to your computer and use it in GitHub Desktop.

Select an option

Save damianh/4b6e3e65250494197ca6 to your computer and use it in GitHub Desktop.
Static middleware template
using AppFunc = Func<IDictionary<string, object>, Task>;
using MidFunc = Func<
Func<IDictionary<string, object>, Task>,
Func<IDictionary<string, object>, Task>
>;
public static class MyMiddleware
{
public static MidFunc UseMyMiddleware()
{
return
next =>
env =>
{
//before
await next(env);
//after
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment