Skip to content

Instantly share code, notes, and snippets.

@corespider
Created May 31, 2020 08:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save corespider/209adbc519f243caded9a8f5f93d24bf to your computer and use it in GitHub Desktop.
Save corespider/209adbc519f243caded9a8f5f93d24bf to your computer and use it in GitHub Desktop.
CoreSpider- Middleware
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.Run(Mymiddleware);
app.Run(async (context) =>
{
await context.Response.WriteAsync("Hello World!");
});
}
private Task Mymiddleware(HttpContext context) {
return context.Response.WriteAsync("Hello World from CoreProgram");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment