Home Reference Source Repository
import Index from 'beerio-api/src/Index.js'
public class | source

Index

Class for starting the API.

Example:

// Simply start the API by creating a new instance of the Index class.
const index = new Index();
// Or override the default configuration of the Index class.
const index = new Index({
   pretty: true,
   verbose: false,
   debug: false
});

Static Method Summary

Static Public Methods
public static

closeAPI(): void

Function to stop the API from running.

Static Private Methods
private static

_startAPI(): void

Function to start the API.

Constructor Summary

Public Constructor
public

constructor(config: Object)

Create an index object.

Static Public Methods

public static closeAPI(): void source

Function to stop the API from running.

Return:

void

Static Private Methods

private static _startAPI(): void source

Function to start the API.

Return:

void

Public Constructors

public constructor(config: Object) source

Create an index object.

Params:

NameTypeAttributeDescription
config Object

Configuration for the API.

config.pretty Boolean
  • optional
  • default: true

Pretty output with Winston logging.

config.verbose Boolean
  • optional
  • default: false

Debug mode for no output.