Split codes to 4 Parts.
1. app.js - API Endpoint ( Receive requests from Facebook page and start to make request to Facebook Graph API ) - Open port ( app.listen(PORT_NUMBER) ), Perform verification ( app.get('/webhook') ) - Use/Call Handler function from controller.js 2. controller.js - Handle Message or Postback - Use/Call model.js / template.js to make response - Make request to Facebook's Graph API ( Messaging Platform ) using response, sender_psid 3. template.js - Make JSON format using data given from controller.js - Return JSON format ( to be 'response' object in controller.js ) 4. models.js - Get data from database. - Give data required by controller.js.
Showing
5 changed files
with
150 additions
and
144 deletions
controller.js
0 → 100644
models.js
0 → 100644
File mode changed
template.js
0 → 100644
-
Please register or login to post a comment