jimpex
    Preparing search index...

    Class ResponsesBuilder

    A utility service to build responses.

    Index

    Constructors

    Properties

    _config: SimpleConfig

    The application configuration, to get the version and the postMessagesPrefix.

    _statuses: Statuses

    The utility service to get HTTP status codes.

    Methods

    • Generates a basic HTML template for the service to use when generating a post message response.

      Parameters

      • title: string

        The HTML <title /> attribute.

      • code: string

        Javascript code to be wrapped on a <script /> tag.

      Returns string

    • Utility method used to make sure a received status is a valid status code. If the status is a string, the method will try to find the code from the statuses package.

      Parameters

      • status: string | number

        The status to normalize.

      Returns number

      If status is a string, but there's no valid code, it will return 200.