Skip to content

ⓧ Solid, extensible middleware for Facebook Messenger bots running on Express

License

Notifications You must be signed in to change notification settings

messengerjs/express-messenger

Repository files navigation

express-messenger NPM version Build Status

Greenkeeper badge

run your Messenger bot on Express

Installation

$ npm install --save express-messenger

Usage

const messenger = require('express-messenger');
const bodyParser = require('body-parser')
const app = require('express')();

app.post('/',
  bodyParser.json(),
  messenger()
    .use((message, context) => {
      switch(context.topic) {
        case 'postback.GET_STARTED':
          // say hi!
        case 'text':
          // send a response
      }
    })
)

Related Projects

messenger-core – Write-once, run-anywhere Messenger bots.

Sponsor

License

MIT © Andreas Pizsa