This middleware will return a 404 response always. It will place itself after all other middleware in the pipeline so that when no other middleware handled the request a 404 response will be returned to the client.
If you want this behaviour only on certain routes through the OWIN pipeline then you can configure this middleware only on those routes. You can also add multiple instances of this middleware to the OWIN pipeline to have different 404 templates for different routes. For example if you have an API that returns JSON, you might want the API to also return JSON in the 404 case.
builder.Register(ninject.Get<OwinFramework.NotFound.NotFoundMiddleware>()) .As("Not found") .ConfigureWith(config, "/owinFramework/middleware/notfound");
The configuration below is the configuration you will get by default if you do not provide a configuration for this middleware.
{ "owinFramework": { "middleware": { "notfound": { "documentationRootUrl": "/owin/notFound/config", "template": "" } } } }