Home Manual Reference Source Test Repository
import Index from 'popcorn-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({
   start: true,
   pretty: true,
   verbose: false,
   debug: false
});

Static Method Summary

Static Public Methods
public static

Function to stop the API from running.

Static Private Methods
private static

_startAPI(start: Boolean)

Function to start the API.

Constructor Summary

Public Constructor
public

constructor(config: Object)

Create an index object.

Static Public Methods

public static closeAPI() source

Function to stop the API from running.

Static Private Methods

private static _startAPI(start: Boolean) source

Function to start the API.

Params:

NameTypeAttributeDescription
start Boolean
  • nullable: true

Start the scraping.

Public Constructors

public constructor(config: Object) source

Create an index object.

Params:

NameTypeAttributeDescription
config Object

Configuration for the API.

config.start Boolean
  • optional
  • default: true

Start the scraping process.

config.pretty Boolean
  • optional
  • default: true

Pretty output with Winston logging.

config.verbose Boolean
  • optional
  • default: false

Debug mode for no output.

config.debug Boolean
  • optional
  • default: false

Debug mode for extra output.