mvaragnat / botkit-messenger-express-demo

Demo of running BotKit for Facebook Messenger on an Express server with MongoDB storage
42 stars 20 forks source link

Routing Question #4

Closed chriscomrie closed 8 years ago

chriscomrie commented 8 years ago

You are using routes in this demo like you would use routing if you were serving files on a typical web site. How does the routing work inside messenger? Can you elaborate on what the routes do?

mvaragnat commented 8 years ago

Messenger requires only one route, '/webhook', where all messages (or buttons clicks, and so on) information is sent.

All the dialog logic is then handled by Botkit, through 'controller.hears' functions or events such as 'controller.on('facebook_optin'