Пример #1
0
        /// <summary>
        /// Adds a new URL pattern with a regex pattern that responds to requests with a template.
        /// </summary>
        /// <param name="pattern">A string in .NET Regex Syntax, specifying the URL pattern.</param>
        /// <param name="template">The path to the template file that is used to render the response.</param>
        /// <param name="contentType">The optional HTTP content-type. Default is "text/html".</param>
        public void AddUrlPattern(string pattern, string templateFile, string contentType = "text/html")
        {
            TemplateRenderer template = Template.FromFile(templateFile);

            AddUrlPattern(pattern, template, contentType);
        }
Пример #2
0
        /// <summary>
        /// Adds a new URL pattern with a static URL. The URL pattern responds to request with a the given template.
        /// </summary>
        public void AddUrl(string url, string templateFile, string contentType = "text/html")
        {
            TemplateRenderer template = Template.FromFile(templateFile);

            AddUrl(url, template, contentType);
        }