broidHQ / broid-kit

Bot framework powered by Broid
Other
60 stars 9 forks source link

Add public method to get express instance #13

Closed killix closed 7 years ago

killix commented 7 years ago

Allow accessing to express instance to add middlewares if necessary. This put compatible @broid/kik wich has an issue with body-parser (https://github.com/kikinteractive/kik-node/issues/8)


const R = require('ramda');
const BroidKik = require('@broid/slack');
const Bot = require("@broid/kit");
const bodyParser = require("body-parser");

const bot = new Bot({
    logLevel: "info",
    http: {
        host: "0.0.0.0",
        port: 8080,
    }
});

bot.getExpress().use(bodyParser.json());
bot.getExpress().use(bodyParser.urlencoded({ extended: false }));
dustinblackman commented 7 years ago

Closing in favour of https://github.com/broidHQ/broid-kit/issues/15