Options
All
  • Public
  • Public/Protected
  • All
Menu

The app parameter available to ApplicationFunctions

property

{logger} log - A logger

Hierarchy

  • Application

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

Properties

auth

auth: (installationId?: undefined | number, log?: Logger) => Promise<InstanceType<typeof ProbotOctokit>>

Type declaration

    • (installationId?: undefined | number, log?: Logger): Promise<InstanceType<typeof ProbotOctokit>>
    • Parameters

      • Optional installationId: undefined | number
      • Optional log: Logger

      Returns Promise<InstanceType<typeof ProbotOctokit>>

load

Type declaration

log

on

on: ProbotWebhooks["on"]

receive

receive: ProbotWebhooks["receive"]

Accessors

router

  • get router(): Router
  • deprecated

    "app.router" is deprecated, use "getRouter()" from the app function instead: "({ app, getRouter }) => { ... }"

    Returns Router

Methods

route

  • route(path?: undefined | string): Router
  • Get an express router that can be used to expose HTTP endpoints

    module.exports = ({ app, getRouter }) => {
      // Get an express router to expose new HTTP endpoints
      const router = getRouter('/my-app');
    
      // Use any middleware
      router.use(require('express').static(__dirname + '/public'));
    
      // Add a new route
      router.get('/hello-world', (req, res) => {
        res.end('Hello World');
      });
    };
    deprecated

    "app.route()" is deprecated, use the "getRouter()" argument from the app function instead: "({ app, getRouter }) => { ... }"

    Parameters

    • Optional path: undefined | string

      the prefix for the routes* @param path

    Returns Router

Legend

  • Constructor
  • Property
  • Method
  • Property
  • Static method

Generated using TypeDoc