Options
All
  • Public
  • Public/Protected
  • All
Menu

Class GistController

Controller for interacting via GitHub Gist API.

See IBaseController for more details.

Hierarchy

  • GistController

Implements

Index

Constructors

constructor

Properties

path

path: string = gistUrl.main

router

router: Router = express.Router()

Methods

Private createGist

  • createGist(req: any, res: any): void
  • Route to create a gist.

    Parameters

    • req: any

      Request object

    • res: any

      Response object

    Returns void

Private fetchAllGistsofUser

  • fetchAllGistsofUser(req: any, res: any): Promise<void>
  • Route to fetch all private and public gists of a user.

    Parameters

    • req: any

      Request object

    • res: any

      Response object

    Returns Promise<void>

Private initializeRoutes

  • initializeRoutes(): void

Private updateGist

  • updateGist(req: any, res: any): void
  • Route to update a gist.

    Parameters

    • req: any

      Request object

    • res: any

      Response object

    Returns void

Static Private sanitize

  • sanitize(data: any, username: string): any
  • Static method to sanitize the output fetched by GitHub gist API.

    Parameters

    • data: any

      Array of gists

    • username: string

      Name of gist creator

    Returns any

Static Private specUrlGenerator

  • specUrlGenerator(fileName: string, gistId: string, username: string): string
  • Static method to generate raw URL

    Parameters

    • fileName: string

      Name of file

    • gistId: string

      ID of gist

    • username: string

      Name of gist creator

    Returns string

Generated using TypeDoc