question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Programatic start

See original GitHub issue

Feature Request

Is your feature request related to a problem? Please describe. Zeit Now 2.0 expects a function that accepts the standard Node.js request and response objects. In order to get this function, I need to use createProbot, load my Probot appFn, and expose probot.webhook.middleware.

//  Simplified for clarity
const { createProbot } = require('probot')
const app = require('../')

const probot = createProbot({
  id: process.env.APP_ID,
  secret: process.env.WEBHOOK_SECRET,
  cert: process.env.PRIVATE_KEY
})

probot.load(app)

module.exports = probot.webhook.middleware

Describe the solution you’d like There seem to be a few use cases that could benefit from a programatic start (probot/friction#8, #780)

This code above is similar to what is suggested in both linked issues, and seems like a reasonable way to implement it. However, it would be nice to have some sort of function to take care of some of the configuration logic. Discussing with @JasonEtco on slack he mentioned a programatic start like this would be something nice to have within Probot itself.

Describe alternatives you’ve considered Another approach, or perhaps complimentary to the above suggestion, would be to create a serverless-now package similar to probot/serverless-lambda.

The simplest thing could be to just update the documentation for deploying to Zeit Now that explains how to deploy with the 2.0 API.

Teachability, Documentation, Adoption, Migration Strategy Not sure I have much more to add here, other than I’d be happy to help out. I was planning to write a simple blog post about it, so I could morph that into a PR for the docs. I could create a serverless-now package (which I’ll probably do on my own if it’s not something Probot wants to manage. Lastly I could look into implementing the programatic start into Probot itself, but realistically I won’t have the time to start on this for at least a week or two.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
passionkindcommented, Dec 22, 2018

Being able to programmatically start probot and exposing the middleware, which receives client request and server response, would probably make further integrations a lot easier.

Coincidentally, I just published an implementation for now v2 based on the lambda version here https://github.com/passionkind/probot-serverless-now

<div> GitHub</div><div>passionkind/probot-serverless-now</div><div>An extension for running Probot on now.sh v2. Contribute to passionkind/probot-serverless-now development by creating an account on GitHub.</div>
2reactions
tibdexcommented, Dec 22, 2018

https://www.npmjs.com/package/probot-serverless-now is another package for running Probot on Now v2. It has the benefit of being closer to the original Probot runtime. Indeed, it supports:

  • Logging
  • Sentry integration
  • Webhook signature verification
<div> npm</div><div>probot-serverless-now</div><div>Probot Wrapper to run GitHub Apps as Lambdas in Zeit's Now 2.0</div>
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Set Up First Programmatic Campaign in 3 Steps
Step #1 — Preparation. Set Your Advertising Campaign Goals; Choose the Type of Programmatic Ad Campaign ; Step #2 — Launch. Estimate Budget...
Read more >
The Beginner's Guide to Programmatic Advertising
The Beginner's Guide to Programmatic Advertising page on the Digital Marketing ... it's important to have your goals set from the start.
Read more >
How to get started and run programmatic ads - Kinetic Marketing
Programmatic advertising uses algorithms and AI to automate digital ad placements and can be a game-changer for your digital campaign.
Read more >
When did Programmatic Advertising Start ? | Gourmet Ads
Programmatic Display Advertising date back almost 30 years to 1994. Find out how the evolution has occurred and how it has shaped digital ......
Read more >
The Evolution of Programmatic Media Buying - Strategus
To provide you with a more thorough understanding of modern-day programmatic media buying, here is where it started and how it has evolved...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found