-
Notifications
You must be signed in to change notification settings - Fork 938
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable /probot redirect #1498
Comments
The WIP app is deployed as serverless application to vercel.com. Vercel is controlling the routing, not the WIP app. Did you try using the new routing API? https://probot.github.io/docs/http/
|
Yes, but the redirect takes priority over it. Here's a reproduction/test case: module.exports = (app, { getRouter }) => {
var router = getRouter('/')
router.get('/', (req, res) => {
res.send('Hello world')
})
} |
Okay, thanks for checking. In that case, I'd run your own server: https://probot.github.io/docs/development/#use-codeservercode. It's not as well documented as it could be, but basically with v11 it's possible to "eject" probot and use the underlying APIs, until you get to point where you can make probot do what you need (and not do what you don't need). That way we don't need to keep adding features for edge cases to Probot, instead we can document how to do what you need using the underlying APIs if your use case is outside probot's core scope Could you see if that works for you? I can help you out if you get stuck. If you could take notes and help improve the docs as you figure things out, that'd be much appreciated
|
That's fine, I can setup a custom server. Thanks. Is it really that "edge-casey" to want We have a requirement that we cannot leak implementation details of how the application works (mainly because of security concerns), meaning if someone stumbles upon the URL and sees "This app was built with Probot", we'd be in trouble. |
It's not necessary an edge case for GitHub apps, but it's out of scope for the
Even more reason to maintain your own server. |
This makes sense to me. I'll mess with |
closing in favor of #1576 |
Ss |
Feature Request
Is your feature request related to a problem? Please describe.
When upgrading from Probot v10 to v11, I cannot disable/bypass the
/
to/probot
redirect. We have a few apps that use the/
route for documentation.Describe the solution you'd like
A way for my app to respond with custom HTML for
GET /
requests.Using Probot v10, this worked fine:
However, with Probot v11, I cannot find a way to do this.
Describe alternatives you've considered
I've tried hacking
server.expressApp._router.stack
, but this seems dangerous. Additionally, the handler which performs the redirect is an anonymous function, so there's no way to safely remove it (cannot useLayer#name
to identify it).Teachability, Documentation, Adoption, Migration Strategy
I can think of a few ways to do this:
server.expressApp._router.stack
Note: I noticed that the WIP app does this in
/api/index.js
, but I have not been able to figure out what is calling/importing that file.Note x 2: I'd be more than happy to work on implementing this if you let me know how you'd like to solve it.
The text was updated successfully, but these errors were encountered: