Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Server

The Http server main class.

Hierarchy

  • Server

Index

Methods

Static buildServices

  • buildServices(router: express.Router): void
  • Create the routes for all classes decorated with our decorators

    Parameters

    • router: express.Router

    Returns void

Static getHttpMethods

  • Return the set oh HTTP verbs configured for the given path

    Parameters

    • path: string

      The path to search HTTP verbs

    Returns Array<HttpMethod>

Static getPaths

  • getPaths(): Array<string>
  • Return all paths accepted by the Server

    Returns Array<string>

Static setCookiesDecoder

  • setCookiesDecoder(decoder: function): void
  • Specifies a function that will be used to decode a cookie's value. This function can be used to decode a previously-encoded cookie value into a JavaScript string. The default function is the global decodeURIComponent, which will decode any URL-encoded sequences into their byte representations.

    NOTE: if an error is thrown from this function, the original, non-decoded cookie value will be returned as the cookie's value.

    Parameters

    • decoder: function

      The decoder function

        • (val: string): string
        • Parameters

          • val: string

          Returns string

    Returns void

Static setCookiesSecret

  • setCookiesSecret(secret: string): void
  • A string used for signing cookies. This is optional and if not specified, will not parse signed cookies.

    Parameters

    • secret: string

      the secret used to sign

    Returns void

Static setFileDest

  • setFileDest(dest: string): void
  • Set where to store the uploaded files

    Parameters

    • dest: string

      Destination folder

    Returns void

Static setFileFilter

  • setFileFilter(filter: function): void
  • Set a Function to control which files are accepted to upload

    Parameters

    • filter: function

      The filter function

        • (req: Request, file: File, callback: function): void
        • Parameters

          • req: Request
          • file: File
          • callback: function
              • (error: Error, acceptFile: boolean): void
              • Parameters

                • error: Error
                • acceptFile: boolean

                Returns void

          Returns void

    Returns void

Static setFileLimits

  • setFileLimits(limit: number): void
  • Set the limits of uploaded data

    Parameters

    • limit: number

      The data limit

    Returns void

Generated using TypeDoc