Home Manual Reference Source Test API Healthcheck
public class | source

Server

Abstraction to manage running the server. Instantiates on application server start up inside entry.js file or wherever the intial "main" script is

Constructor Summary

Public Constructor
public

Server Constructor

Member Summary

Public Members
public

logDir: *

public

name: *

public

server: *

Method Summary

Public Methods
public

addEndpoint(endpoint: EndpointConfig): undefined

Adds an endpoint at the path given handled by the controller

public

addEndpoints(routes: Array<EndpointConfig>): undefined

Adds the endpoints given to the server

public

log(tags: string[], data: string): undefined

Logs a message through hapi-pino

public

async run(): Promise

Starts the server and registers any plugins

public

Shutdown the Hapi Server Properly

Public Constructors

public constructor() source

Server Constructor

Public Members

public logDir: * source

public name: * source

public server: * source

Public Methods

public addEndpoint(endpoint: EndpointConfig): undefined source

Adds an endpoint at the path given handled by the controller

Params:

NameTypeAttributeDescription
endpoint EndpointConfig

configuration

Return:

undefined

public addEndpoints(routes: Array<EndpointConfig>): undefined source

Adds the endpoints given to the server

Params:

NameTypeAttributeDescription
routes Array<EndpointConfig>

Routes to add to the server

Return:

undefined

public log(tags: string[], data: string): undefined source

Logs a message through hapi-pino

Params:

NameTypeAttributeDescription
tags string[]

for pino log record

data string

for pino log record

Return:

undefined

public async run(): Promise source

Starts the server and registers any plugins

Return:

Promise

Resolves once server has started

public shutdown(callback: Function): undefined source

Shutdown the Hapi Server Properly

Params:

NameTypeAttributeDescription
callback Function

callback to run after server has shutdown

Return:

undefined

no return