@@ -12,6 +12,7 @@ import {
1212 getMessage ,
1313 isCLARequired ,
1414 isMessageAfterMergeRequired ,
15+ getWebsiteAddress ,
1516} from "./src/helpers.js" ;
1617import Slack from "./src/services/Slack.js" ;
1718
2425 console . error ( "Failed to get the version number" ) ;
2526}
2627console . log ( `Application version: ${ APP_VERSION } ` ) ;
27- console . log ( `Website address: ${ process . env . WEBSITE_ADDRESS } ` ) ;
2828
2929// Set configured values
3030const appId = process . env . APP_ID ;
@@ -211,6 +211,7 @@ app.webhooks.onError((error) => {
211211const port = process . env . PORT || 3000 ;
212212const webhookPath = "/api/webhook" ;
213213const localWebhookUrl = `http://localhost:${ port } ${ webhookPath } ` ;
214+ const publicWebhookUrl = getWebsiteAddress ( ) + webhookPath ;
214215
215216// See https://github.com/octokit/webhooks.js/#createnodemiddleware for all options
216217const middleware = createNodeMiddleware ( app . webhooks , { path : webhookPath } ) ;
@@ -258,9 +259,13 @@ http
258259 }
259260 } )
260261 . listen ( port , ( ) => {
261- console . log ( `Server is listening for events at: ${ localWebhookUrl } ` ) ;
262262 console . log (
263- "Server is also serving the homepage at: http://localhost:" + port
263+ "Server is running at:" ,
264+ `\n Local: http://localhost:${ port } ` ,
265+ `\n Public: ${ getWebsiteAddress ( ) } `
264266 ) ;
267+ console . log ( "Listening for webhook events at:" ,
268+ `\n Local webhook url: ${ localWebhookUrl } ` ,
269+ `\n Public webhook url: ${ publicWebhookUrl } ` ) ;
265270 console . log ( "Press Ctrl + C to quit." ) ;
266271 } ) ;
0 commit comments