You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Could not verify webhook with Facebook, getting a 404 error with the file structure in Master: Cannot GET /
I copied your file structure, but had to change line 22 to start serving webhook,js, changing '/webhook' to '/' I think because webhook is in root and my relative link was wrong when I copied the Master branch code. I'm on a windows machine.
My working code:
/* For Facebook Validation */
//Replace the'/' below with proper relative link or absolute link if serving fron the internet
app.get('/', (req, res) => {
if (req.query['hub.mode'] && req.query['hub.verify_token'] === 'tuxedo_cat') {
res.status(200).send(req.query['hub.challenge']);
} else {
res.status(403).end();
}
});
/* Handling all messenges */
//Replace the'/' below with proper relative link or absolute link if serving fron the internet
app.post('/', (req, res) => {
console.log(req.body);
if (req.body.object === 'page') {
req.body.entry.forEach((entry) => {
entry.messaging.forEach((event) => {
if (event.message && event.message.text) {
sendMessage(event);
}
});
});
res.status(200).end();
}
});
The text was updated successfully, but these errors were encountered:
LeeWarnock
changed the title
/webhook relative link not working so serve GET
/webhook relative link not working to serve GET
Jul 26, 2017
Could not verify webhook with Facebook, getting a 404 error with the file structure in Master: Cannot GET /
I copied your file structure, but had to change line 22 to start serving webhook,js, changing '/webhook' to '/' I think because webhook is in root and my relative link was wrong when I copied the Master branch code. I'm on a windows machine.
My working code:
The text was updated successfully, but these errors were encountered: