Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Server

Index

Properties

app

app: Express

The Express application.

Accessors

Static Instance

  • Returns Server

Methods

apiCheckCredentials

  • apiCheckCredentials(req: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>): boolean
  • Helper to check the credentials passed on API requests.

    Parameters

    • req: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>
    • res: Response<any, Record<string, any>>

    Returns boolean

apiListRoute

  • apiListRoute(req: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>): Promise<void>
  • Get full list of links registered on the system.

    Parameters

    • req: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>
    • res: Response<any, Record<string, any>>

    Returns Promise<void>

getClientCountry

  • getClientCountry(req: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>): Promise<string>
  • Get the client's country address based on headers and IP.

    Parameters

    • req: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>

      Request object.

    Returns Promise<string>

getClientIP

  • getClientIP(req: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>): string
  • Get the client's IP address.

    Parameters

    • req: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>

      Request object.

    Returns string

indexRoute

  • indexRoute(req: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>): Promise<void>
  • Homepage route.

    Parameters

    • req: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>
    • res: Response<any, Record<string, any>>

    Returns Promise<void>

init

  • init(): Promise<void>
  • Setup the routes and start the HTTP server.

    Returns Promise<void>

linkRoute

  • linkRoute(req: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>): Promise<void>
  • Main link redirection route.

    Parameters

    • req: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>
    • res: Response<any, Record<string, any>>

    Returns Promise<void>

searchRoute

  • searchRoute(req: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>): Promise<void>
  • Search by query route.

    Parameters

    • req: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>
    • res: Response<any, Record<string, any>>

    Returns Promise<void>

Generated using TypeDoc