Application
Extends:
Represents an application providing functionalities specific to Web requests.
Test:
Static Member Summary
Static Public Members | ||
public static get |
The default address that the application is listening on. |
|
public static get |
The default port that the application is listening on. |
Constructor Summary
Public Constructor | ||
public |
constructor(rootPath: string) Initializes a new instance of the class. |
Member Summary
Public Members | ||
public |
[key]: * |
|
public get |
The address that the application is listening on. |
|
public get |
The base path of the application files. |
|
public set |
Sets the base path of the application files. |
|
public get |
The directory that contains the controller classes. |
|
public set |
controllerPath(value: string): * Sets the directory that contains the controller classes. |
|
public get |
Value indicating whether the application runs in debug mode. |
|
public get |
Value indicating whether the application must use a secure connection. |
|
public get |
Value indicating whether the application is currently listening. |
|
public get |
mailer: Mailer The mailer application component. |
|
public get |
The application name. |
|
public |
Custom application parameters. |
|
public get |
The port that the application is listening on. |
|
public get |
The Web root directory that contains the static files. |
|
public set |
publicPath(value: string): * Sets the Web root directory that contains the static files. |
|
public get |
The directory that stores runtime files. |
|
public set |
runtimePath(value: string): * Sets the directory that stores runtime files. |
|
public get |
The version number of this application. |
|
public get |
The directory that contains the view files. |
|
public set |
Sets the directory that contains the view files. |
Method Summary
Public Methods | ||
public |
Stops the application from accepting new connections. |
|
public |
Terminates the application. |
|
public |
Gets the component instance with the specified identifier. |
|
public |
Gets a value indicating whether the application has instantiated the component with the specified identifier. |
|
public |
Initializes the application. |
|
public |
Begin accepting connections. |
|
public |
Removes the component instance with the specified identifier. |
|
public |
Runs the application. |
|
public |
Registers a component instance with this application. |
Static Public Members
Public Constructors
Public Members
public [key]: * source
public set controllerPath(value: string): * source
Sets the directory that contains the controller classes.
public get forceSSL: boolean source
Value indicating whether the application must use a secure connection.
public get listening: boolean source
Value indicating whether the application is currently listening.
Test:
Public Methods
public async close(): Promise source
Stops the application from accepting new connections. It does nothing if the application is already closed.
Emit:
* |
The "close" event. |
public async end(status: number) source
Terminates the application.
This method replaces the process.exit()
method by ensuring the application life cycle is completed before terminating the application.
Params:
Name | Type | Attribute | Description |
status | number |
|
The exit status (value |
Emit:
* |
The "end" event. |
public get(id: string, throwError: boolean): * source
Gets the component instance with the specified identifier.
Return:
* | The component of the specified identifier, or a |
Throw:
The specified identifier refers to a nonexistent component while |
public has(id: string): boolean source
Gets a value indicating whether the application has instantiated the component with the specified identifier.
Params:
Name | Type | Attribute | Description |
id | string | The component identifier. |
public init(config: object) source
Initializes the application.
Params:
Name | Type | Attribute | Description |
config | object |
|
An object specifying the application configuration. |
public async listen(port: number, address: string): Promise<number> source
Begin accepting connections. It does nothing if the application is already started.
Emit:
* |
The "listening" event. |
public remove(id: string) source
Removes the component instance with the specified identifier.
Params:
Name | Type | Attribute | Description |
id | string | The component identifier. |