import { Application , createProbot } from "probot" ; import { findPrivateKey } from "probot/lib/private-key" ; import healthcheck from "../frontend/healthcheck" ; import { overrideProbotLoggingMethods } from "../config/logger" ; export const probot = createProbot ( { id : Number ( process . env . APP_ID ) , cert : findPrivateKey ( ) || undefined , secret : undefined , port : Number ( process . env . WORKER_PORT ) || Number ( process . env . PORT ) || 8081 , webhookPath : undefined , webhookProxy : undefined } ) ; const App = async ( app ) : Promise < Application > => { const router = app . route ( ) ; router . use ( "/" , healthcheck ) ; return app ; } ; probot . server . set ( "trust proxy" , true ) ; overrideProbotLoggingMethods ( probot . logger ) ; export default probot . load ( App ) ;