Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TemplateHandler

A handler which renders responses using a template engine and where the template name is selected from the URI path.

Hierarchy

  • TemplateHandler

Implements

  • any

Index

Properties

Static Readonly DEFAULT_CONTENT_TYPE

DEFAULT_CONTENT_TYPE: string

The default content type header to be used in the response

Static Readonly DEFAULT_INDEX_TEMPLATE

DEFAULT_INDEX_TEMPLATE: string

The default index page

Static Readonly DEFAULT_TEMPLATE_DIRECTORY

DEFAULT_TEMPLATE_DIRECTORY: string

The default directory where templates will be looked for

Methods

handle

  • Parameters

    Returns void

setIndexTemplate

  • Set the index template

    Parameters

    • indexTemplate: string

    Returns TemplateHandler

Static create

  • Create a handler

    Parameters

    • engine: TemplateEngine

    Returns TemplateHandler

  • Create a handler

    Parameters

    • engine: TemplateEngine
    • templateDirectory: string
    • contentType: string

    Returns TemplateHandler

Generated using TypeDoc