How to use the bottender/express.registerRoutes function in bottender

To help you get started, we’ve selected a few bottender examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Yoctol / bottender / examples / cross-platform / index.js View on Github external
})
);

const bots = {
  messenger: new MessengerBot(config.messenger).onEvent(handler),
  line: new LineBot(config.line).onEvent(handler),
  slack: new SlackBot(config.slack).onEvent(handler),
  telegram: new TelegramBot(config.telegram).onEvent(handler),
  viber: new ViberBot(config.viber).onEvent(handler),
};

registerRoutes(server, bots.messenger, {
  path: '/messenger',
  verifyToken: config.messenger.verifyToken,
});
registerRoutes(server, bots.line, { path: '/line' });
registerRoutes(server, bots.slack, { path: '/slack' });
registerRoutes(server, bots.telegram, { path: '/telegram' });
registerRoutes(server, bots.viber, { path: '/viber' });

server.listen(5000, () => {
  console.log('server is listening on 5000 port...');
});
github Yoctol / bottender / examples / cross-platform / index.js View on Github external
const bots = {
  messenger: new MessengerBot(config.messenger).onEvent(handler),
  line: new LineBot(config.line).onEvent(handler),
  slack: new SlackBot(config.slack).onEvent(handler),
  telegram: new TelegramBot(config.telegram).onEvent(handler),
  viber: new ViberBot(config.viber).onEvent(handler),
};

registerRoutes(server, bots.messenger, {
  path: '/messenger',
  verifyToken: config.messenger.verifyToken,
});
registerRoutes(server, bots.line, { path: '/line' });
registerRoutes(server, bots.slack, { path: '/slack' });
registerRoutes(server, bots.telegram, { path: '/telegram' });
registerRoutes(server, bots.viber, { path: '/viber' });

server.listen(5000, () => {
  console.log('server is listening on 5000 port...');
});
github zaoldyeck / cross-platform-chatbot / src / index.js View on Github external
server.use(
    bodyParser.json({
        verify: (req, res, buf) => {
            req.rawBody = buf.toString()
        }
    })
)

const bots = {
    line: new LineBot(config.line).onEvent(lineHandler),
    messenger: new MessengerBot(config.messenger).onEvent(messengerHandler)
}

registerRoutes(server, bots.line, {path: '/line'})
registerRoutes(server, bots.messenger, {
    path: '/messenger',
    verifyToken: config.messenger.verifyToken,
})

server.listen(process.env.PORT || 5000, () => {
    console.log('server is listening on 5000 port...')
})
github Yoctol / bottender / examples / cross-platform / index.js View on Github external
);

const bots = {
  messenger: new MessengerBot(config.messenger).onEvent(handler),
  line: new LineBot(config.line).onEvent(handler),
  slack: new SlackBot(config.slack).onEvent(handler),
  telegram: new TelegramBot(config.telegram).onEvent(handler),
  viber: new ViberBot(config.viber).onEvent(handler),
};

registerRoutes(server, bots.messenger, {
  path: '/messenger',
  verifyToken: config.messenger.verifyToken,
});
registerRoutes(server, bots.line, { path: '/line' });
registerRoutes(server, bots.slack, { path: '/slack' });
registerRoutes(server, bots.telegram, { path: '/telegram' });
registerRoutes(server, bots.viber, { path: '/viber' });

server.listen(5000, () => {
  console.log('server is listening on 5000 port...');
});
github Yoctol / bottender / examples / cross-platform / index.js View on Github external
const bots = {
  messenger: new MessengerBot(config.messenger).onEvent(handler),
  line: new LineBot(config.line).onEvent(handler),
  slack: new SlackBot(config.slack).onEvent(handler),
  telegram: new TelegramBot(config.telegram).onEvent(handler),
  viber: new ViberBot(config.viber).onEvent(handler),
};

registerRoutes(server, bots.messenger, {
  path: '/messenger',
  verifyToken: config.messenger.verifyToken,
});
registerRoutes(server, bots.line, { path: '/line' });
registerRoutes(server, bots.slack, { path: '/slack' });
registerRoutes(server, bots.telegram, { path: '/telegram' });
registerRoutes(server, bots.viber, { path: '/viber' });

server.listen(5000, () => {
  console.log('server is listening on 5000 port...');
});
github zaoldyeck / cross-platform-chatbot / src / index.js View on Github external
const server = new express()

server.use(
    bodyParser.json({
        verify: (req, res, buf) => {
            req.rawBody = buf.toString()
        }
    })
)

const bots = {
    line: new LineBot(config.line).onEvent(lineHandler),
    messenger: new MessengerBot(config.messenger).onEvent(messengerHandler)
}

registerRoutes(server, bots.line, {path: '/line'})
registerRoutes(server, bots.messenger, {
    path: '/messenger',
    verifyToken: config.messenger.verifyToken,
})

server.listen(process.env.PORT || 5000, () => {
    console.log('server is listening on 5000 port...')
})
github Yoctol / bottender / examples / cross-platform / index.js View on Github external
bodyParser.json({
    verify: (req, res, buf) => {
      req.rawBody = buf.toString();
    },
  })
);

const bots = {
  messenger: new MessengerBot(config.messenger).onEvent(handler),
  line: new LineBot(config.line).onEvent(handler),
  slack: new SlackBot(config.slack).onEvent(handler),
  telegram: new TelegramBot(config.telegram).onEvent(handler),
  viber: new ViberBot(config.viber).onEvent(handler),
};

registerRoutes(server, bots.messenger, {
  path: '/messenger',
  verifyToken: config.messenger.verifyToken,
});
registerRoutes(server, bots.line, { path: '/line' });
registerRoutes(server, bots.slack, { path: '/slack' });
registerRoutes(server, bots.telegram, { path: '/telegram' });
registerRoutes(server, bots.viber, { path: '/viber' });

server.listen(5000, () => {
  console.log('server is listening on 5000 port...');
});