Static Member Summary
| Static Public Members | ||
| public static |
app: $Application The application instance for the PopApi framework. |
|
| public static |
The database connection. |
|
| public static |
The debugger for extra output. |
|
| public static |
The arguments passed down to the logger middleware. |
|
| Static Private Members | ||
| private static |
A map of the installed plugins. |
|
Static Method Summary
| Static Public Methods | ||
| public static |
The setup for the base framework. |
|
| public static |
Register middleware for the PopApi framework. |
|
Static Public Members
Static Private Members
Static Public Methods
public static async init(options: Object, middlewares: Array<Function>): Promise<PopApi, Error> source
The setup for the base framework.
Params:
| Name | Type | Attribute | Description |
| options | Object |
|
The options for the framework. |
| options.app | Express |
|
The web framework instance you want to use. |
| options.controllers | Array<Object> |
|
The controllers to register. |
| options.name | string |
|
The name for your API. |
| options.version | string |
|
The version of your API. |
| options.logDir | string |
|
The directory to store the log files in. |
| options.hosts | Array<string> |
|
The hosts of the database cluster. |
| options.dbPort | number |
|
The port the database is on. |
| options.username | string |
|
The username for the database connection. |
| options.password | string |
|
The password for the database connection. |
| options.serverPort | number |
|
The port the API will run on. |
| options.workers | number |
|
The number of workers for the API. |
| options.opts | Object |
|
Additionl options for custom middlewares. |
| middlewares | Array<Function> |
|
The list of middlewares to use. The order of the middlewares is important. |
Manual
Reference
Source
Test
