Home Manual Reference Source Test Repository
public class | source

Index

class for displaying information about the server the API is running on.

Test:

Static Method Summary

Static Private Methods
private static

_displayFile(req: Request, res: Response, root: String, file: String): JSON | File

Displays a given file.

Constructor Summary

Public Constructor
public

Create an index object.

Method Summary

Public Methods
public

getErrorLog(req: Request, res: Response): File

Displays the 'popcorn-api.log' file.

public

getIndex(req: Request, res: Response, next: Function): JSON

Get general information about the server.

Static Private Methods

private static _displayFile(req: Request, res: Response, root: String, file: String): JSON | File source

Displays a given file.

Params:

NameTypeAttributeDescription
req Request

The express request object.

res Response

The express response object.

root String

The path to the file.

file String

The name of the file.

Return:

JSON | File

A file to display in the browser.

Public Constructors

public constructor source

Create an index object.

Public Methods

public getErrorLog(req: Request, res: Response): File source

Displays the 'popcorn-api.log' file.

Params:

NameTypeAttributeDescription
req Request

The express request object.

res Response

The express response object.

Return:

File

The content of the log file.

Test:

public getIndex(req: Request, res: Response, next: Function): JSON source

Get general information about the server.

Params:

NameTypeAttributeDescription
req Request

The express request object.

res Response

The express response object.

next Function

The next function for Express.

Return:

JSON

General information about the server.

Test: