CoreServer
The CoreServer class is used as a basis for creating new servers. It uses Server class from the @hapi/hapi package. The CoreServer class provides a set of methods that can be used when creating a new server. Additionally there are methods that have to be implemented by classes that extend from CoreServer class.
Following methods are provided:
| Name | Description |
|---|---|
| initializeDirectories | Initializes staticPath field. |
| createServer | Creates a new Server instance from the @hapi/hapi package based on the project configuration. The Server instance is stored in the server field. |
| registerRoutes | Associates the route config with correct controller handler methods. |
| registerModules | Registers provided modules. |
| registerServices | Registers provided services. |
| registerControllers | Registers provided controllers. Initialized controllers are stored in the controllers field. |
| registerPlugins | Registers provided plugins. |
| init | Configuration initialization (loads the archibald config into the ConfigManager). |
| start | Not implemented. It has to be implemented in the project. |
| stop | Stops the underlying hapi server, logs the shutdown and exits the process. |
| dispose | Stops the underlying hapi server without exiting the process. |