Class BaseAppAbstract

Abstract application

Hierarchy (view full)

Implements

Constructors

Properties

__app: Application
__router: IRouter

Accessors

  • get _app(): Application
  • Express Application

    Returns Application

  • get _router(): IRouter
  • Main router

    Returns IRouter

  • get meta(): RouteMeta[]
  • Returns RouteMeta[]

  • get server(): undefined | Server<typeof IncomingMessage, typeof ServerResponse>
  • Returns undefined | Server<typeof IncomingMessage, typeof ServerResponse>

Methods

  • Type Parameters

    • T extends ServerOptions<typeof IncomingMessage, typeof ServerResponse> = ServerOptions<typeof IncomingMessage, typeof ServerResponse>

    Parameters

    • Optionaloptions: null | T
    • Optionalmod: {
          createServer(requestListener?: RequestListener<typeof IncomingMessage, typeof ServerResponse>): Server<typeof IncomingMessage, typeof ServerResponse>;
          createServer(options: T, requestListener?: RequestListener<typeof IncomingMessage, typeof ServerResponse>): Server<typeof IncomingMessage, typeof ServerResponse>;
      }

      Module that will create the server (e.g.: require('https'))

      • createServer:function
        • Parameters

          • OptionalrequestListener: RequestListener<typeof IncomingMessage, typeof ServerResponse>

          Returns Server<typeof IncomingMessage, typeof ServerResponse>

        • Parameters

          • options: T
          • OptionalrequestListener: RequestListener<typeof IncomingMessage, typeof ServerResponse>

          Returns Server<typeof IncomingMessage, typeof ServerResponse>

    Returns Server<typeof IncomingMessage, typeof ServerResponse>

    const https = require('https');
    const server = app.build(HTTPS_SERVER_OPTIONS, https);
    server.listen(PORT);
  • Parameters

    • ext: string
    • fn: ((path: string, options: object, callback: ((e: any, rendered?: string) => void)) => void)
        • (path, options, callback): void
        • Parameters

          • path: string
          • options: object
          • callback: ((e: any, rendered?: string) => void)
              • (e, rendered?): void
              • Parameters

                • e: any
                • Optionalrendered: string

                Returns void

          Returns void

    Returns this

  • Parameters

    • setting: string

    Returns any

  • Creates a router and adds it to the application.

    Parameters

    • Optionaloptions: RouterOptions

    Returns IRouter

    The created router

  • Parameters

    • Optionalport: number
    • Optionalhostname: string
    • Optionalbacklog: number
    • OptionallisteningListener: (() => void)
        • (): void
        • Returns void

    Returns Server<typeof IncomingMessage, typeof ServerResponse>

  • Parameters

    • Optionalport: number
    • Optionalhostname: string
    • OptionallisteningListener: (() => void)
        • (): void
        • Returns void

    Returns Server<typeof IncomingMessage, typeof ServerResponse>

  • Parameters

    • Optionalport: number
    • Optionalbacklog: number
    • OptionallisteningListener: (() => void)
        • (): void
        • Returns void

    Returns Server<typeof IncomingMessage, typeof ServerResponse>

  • Parameters

    • Optionalport: number
    • OptionallisteningListener: (() => void)
        • (): void
        • Returns void

    Returns Server<typeof IncomingMessage, typeof ServerResponse>

  • Parameters

    • path: string
    • Optionalbacklog: number
    • OptionallisteningListener: (() => void)
        • (): void
        • Returns void

    Returns Server<typeof IncomingMessage, typeof ServerResponse>

  • Parameters

    • path: string
    • OptionallisteningListener: (() => void)
        • (): void
        • Returns void

    Returns Server<typeof IncomingMessage, typeof ServerResponse>

  • Parameters

    • options: ListenOptions
    • OptionallisteningListener: (() => void)
        • (): void
        • Returns void

    Returns Server<typeof IncomingMessage, typeof ServerResponse>

  • Parameters

    • handle: unknown
    • Optionalbacklog: number
    • OptionallisteningListener: (() => void)
        • (): void
        • Returns void

    Returns Server<typeof IncomingMessage, typeof ServerResponse>

  • Parameters

    • handle: unknown
    • OptionallisteningListener: (() => void)
        • (): void
        • Returns void

    Returns Server<typeof IncomingMessage, typeof ServerResponse>

  • Parameters

    • event: string
    • callback: ((parent: Application<Record<string, any>>) => void)
        • (parent): void
        • Parameters

          • parent: Application<Record<string, any>>

          Returns void

    Returns BaseApp