Constructor Summary
| Public Constructor | ||
| public |
constructor(PopApi: PopApi, options: Object) Create a new Server object. |
|
Member Summary
| Public Members | ||
| public |
the http server object. |
|
| public |
The port on which the API will run on. |
|
| public |
The amount of workers on the cluster. |
|
Method Summary
| Public Methods | ||
| public |
Method to stop the API from running. |
|
| public |
For the workers. |
|
| public |
Method to setup the cron job. |
|
| public |
Handle the errors for workers. |
|
Public Constructors
public constructor(PopApi: PopApi, options: Object) source
Create a new Server object.
Params:
| Name | Type | Attribute | Description |
| PopApi | PopApi |
|
The PopApi instance to bind the server to. |
| options | Object |
|
The options for the server. |
| options.app | Express |
|
The application instance to create a server for. |
| options.serverPort | number |
|
The port the API will run on. |
| options.workers | number |
|
The amount of workers to fork. |
Throw:
'app' is a required option for the HttpServer middleware! |
Public Members
Public Methods
public closeApi(database: Database, done: Function): undefined source
Method to stop the API from running.
public setupApi(app: Express): undefined source
Method to setup the cron job.
Params:
| Name | Type | Attribute | Description |
| app | Express |
|
The application instance to create a server for. |
Manual
Reference
Source
Test
