Class BaseAppAbstract

Abstract application

Hierarchy (view full)

Implements

Constructors

  • Parameters

    Returns BaseApp

Properties

__app: Application
__router: IRouter

Accessors

  • get _app(): Application
  • Express Application

    Returns Application

  • get _router(): IRouter
  • Main router

    Returns IRouter

  • get building(): boolean
  • Returns boolean

  • get built(): boolean
  • Returns boolean

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

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

Methods

  • Parameters

    • options: FrameworkOptions

    Returns BaseApp

  • Parameters

    • options: Options

      Options to concatenate with current options.

    Returns BaseApp

  • Parameters

    • routers: IRouter | IRouter[]

    Returns BaseApp

  • 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

    • setting: string

    Returns BaseApp

  • Parameters

    • setting: string

    Returns boolean

  • Parameters

    • setting: string

    Returns BaseApp

  • Parameters

    • setting: string

    Returns boolean

  • 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

  • Parameters

    • setting: string
    • Optionalval: unknown

    Returns BaseApp

  • Type Parameters

    • P = ParamsDictionary
    • ResBody = any
    • ReqBody = any
    • ReqQuery = ParsedQs
    • Locals extends Record<string, any> = Record<string, any>

    Parameters

    Returns BaseApp