Probot's setup mode is easily overlooked and leaves users confused why the app is not working
See original GitHub issueBug Report
Current Behavior I am trying to add a simple express route for a health check on my probot app. I was getting a 404 on my custom configuration, so I revisited the docs to see how to add the express route for this. Even when I overwrite my exported function with the example code from the documentation below, I still get a 404. How is this supposed to work? Are express routes supported?
module.exports = app => {
// Get an express router to expose new HTTP endpoints
const router = app.route('/my-app')
// Use any middleware
router.use(require('express').static('public'))
// Add a new route
router.get('/hello-world', (req, res) => {
res.send('Hello World')
})
}
Welcome to Probot! Go to http://localhost:3000 to get started.
22:44:08.663Z INFO probot: Forwarding https://smee.io/2xurzllqp8L84xa to http://localhost:3000/
22:44:08.664Z INFO probot: Listening on http://localhost:3000
22:44:08.742Z INFO probot: Connected https://smee.io/2xurzllqp8L84xa
22:44:09.424Z INFO http: GET /probot/my-app/hello-world 404 - 4.36 ms (id=8b2c2cbd-bad5-4fce-bc49-7e604944a6ce)
22:44:11.912Z INFO http: GET /my-app/hello-world 404 - 0.98 ms (id=fb8c57dc-a01f-49a0-85db-ce48369696e8)
Expected behavior/code I would expect to get a 200 back in this case.
Environment
- Probot version(s): tested 9.9.4 & 9.11.3
- Node/npm version: tested v12.14.1 (npm v6.13.4) & v14.0.0 (npm v6.14.4)
- OS: OSX 10.14.6
Possible Solution N/A
Additional context/Screenshots None
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (5 by maintainers)
Top Results From Across the Web
Quit and reopen an app on iPhone - Apple Support
To reopen the app, go to the Home Screen (or App Library), then tap the app. If quitting and reopening the app doesn't...
Read more >iOS 16 Focus Guide: What's New With Apple's Focus Mode
Apple in iOS 15 introduced Focus mode, an expansion of Do Not Disturb that allows you to set up different permissions for apps,...
Read more >How to Setup and Use ProBot on Discord - TechWiser
ProBot has features like Automod, Auto Responder, Reaction Roles, Welcome message. Here's how to set up, manage, and use ProBot on Discord.
Read more >discord join role bot
Allow Users to Self Assign Roles in Discord with the MEE6 Bot Reaction Roles. ... To set up ProBot on your Discord server,...
Read more >iOS 16.2 Settings You Need To Turn Off Now - YouTube
There are several new iOS 16 settings you need to know about, ... Restrict App Permissions [1:28] 5. ... 5G Auto & Data...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
https://github.com/probot/probot/issues/1069 ^ Seems like someone else was previously having the same problem. When I do an
app.log
within the block, it seems like it’s ignoredIs this documented somewhere? I already have QA and production versions of my github app that I created while being a superuser in my org, and I was trying to circle back and create a sane development environment for our other devs, so they can build and test any additions to our app. They won’t be able to update the app configuration (e.g. the event endpoint) or install any github apps to our org. Thus I didn’t want to share any configuration with the existing deployed environments. Is there an easy workaround or recommended setup for this?
It was frustrating to try add simple code like a health check endpoint and logging only to see them not run locally. I wasn’t able to figure out how to test these without deploying, and there were no error messages telling me why my code wasn’t running.