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

Folders and files

NameName
Last commit message
Last commit date

Latest commit

4111d3a · Mar 7, 2018

History

13 Commits
Oct 12, 2017
Oct 12, 2017
Oct 9, 2017
Oct 9, 2017
Oct 9, 2017
Oct 12, 2017
Oct 12, 2017
Oct 9, 2017
Mar 7, 2018
Oct 9, 2017
Oct 12, 2017
Oct 24, 2017

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