private Task DocumentConfiguration(IOwinContext context)
        {
            var document = GetEmbeddedResource("configuration.html");

            document = document.Replace("{template}", _configuration.Template);
            document = document.Replace("{documentationUrl}", _configuration.DocumentationRootUrl);

            var defaultConfiguration = new NotFoundConfiguration();

            document = document.Replace("{template.default}", defaultConfiguration.Template);
            document = document.Replace("{documentationUrl.default}", defaultConfiguration.DocumentationRootUrl);

            context.Response.ContentType = "text/html";
            return(context.Response.WriteAsync(document));
        }
        private void ConfigurationChanged(NotFoundConfiguration configuration)
        {
            FileInfo pageTemplateFile = null;

            if (!string.IsNullOrEmpty(configuration.Template))
            {
                var fullPath = _hostingEnvironment.MapPath(configuration.Template);
                pageTemplateFile = new FileInfo(fullPath);
            }

            if (string.IsNullOrEmpty(configuration.DocumentationRootUrl))
            {
                configuration.DocumentationRootUrl = null;
            }
            else if (!configuration.DocumentationRootUrl.StartsWith("/"))
            {
                configuration.DocumentationRootUrl = "/" + configuration.DocumentationRootUrl;
            }

            _configuration    = configuration;
            _configPage       = configuration.DocumentationRootUrl == null ? PathString.Empty : new PathString(configuration.DocumentationRootUrl);
            _pageTemplateFile = pageTemplateFile;
        }