Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Application

Application is the base class for all web application classes.

property-read

ErrorHandler $errorHandler The error handler application component. This property is read-only.

property

string $homeUrl The homepage URL.

property-read

Request $request The request component. This property is read-only.

property-read

Response $response The response component. This property is read-only.

property-read

Session $session The session component. This property is read-only.

property-read

User $user The user component. This property is read-only.

author

Mahesh S Warrier https://github.com/codespede

Hierarchy

Index

Constructors

Properties

initialization: Promise<void>

A Promise which resolves when this Component has been successfully initialized.

_ormAdapter: any
aliases: {} = {}
var

registered path aliases

see

getAlias

see

setAlias

Type declaration

    orm: string = 'sequelize'

    The ORM that should be used by the application. Defaults to 'sequelize' Any other ORM if used should have an ORMAdapter defined in ormAdapterClasses

    ormAdapterClasses: {} = ...

    The adapters for any ORMs used by this application. The key of the adapter to be used should be specified in orm

    Type declaration

    • [key: string]: any
    request: {}

    Type declaration

    • [key: string]: any
    response: {} = ...

    Type declaration

    • [key: string]: any
    serializer: Serializer = ...

    The Serializer that should be used for RESTful operations.

    view: any = null

    The View object for the application that is used to render various view files..

    viewPath: string

    The directory that contains the view files for this module.

    Methods

    • init(): Promise<void>
    • Initializes the object. This method is invoked at the end of the constructor after the object is initialized with the given configuration.

      Returns Promise<void>

    • getAlias(alias: string): any
    • Translates a path alias into an actual path.

      see

      setAlias

      Parameters

      • alias: string

        The alias to be translated.

      Returns any

      The translated alias.

    • getFullUrlOfRequest(): string
    • getORMAdapter(): any
    • getViewPath(): string
    • ormModelClass(): any
    • The model class for the ORM being used. Eg:- [[sequelize.Model]] for Sequelize This should be set in the entry script of the application like:

      import { DataTypes, Model } from 'sequelize';
      Application.ormModelClass = Model;

      Returns any

    • respond(nativeResponse: any, data?: any): Promise<any>
    • Responds to the client(eg:- browser) depending on the data.

      Parameters

      • nativeResponse: any
      • data: any = null

      Returns Promise<any>

    • responsify(response: any): any
    • Adds necessary headers and status code to the given response.

      Parameters

      • response: any

      Returns any

    • setAlias(alias: any, path: any): void
    • Registers a path alias.

      A path alias is a short name representing a long path (a file path, a URL, etc.)

      Parameters

      • alias: any
      • path: any

      Returns void

    • setORMAdapter(adapter: any): void
    • Sets the ORM Adapter.

      paramadapter

      The ORM Adapter class to be set.

      Parameters

      • adapter: any

      Returns void

    • setORMModelClass(modelClass: any): void
    • setViewPath(path: string): void

    Generated using TypeDoc