diff --git a/README.md b/README.md index a58330c..9f6f52a 100644 --- a/README.md +++ b/README.md @@ -76,8 +76,6 @@ const botConfig = { let app = express() const skills = [] app = extendApp(app, skills, eventHandler, botConfig) -app.use(express.json()); -app.use(express.urlencoded({extended: true})); app.listen(3000, () => { console.log('server running') }) diff --git a/src/index.ts b/src/index.ts index ee36f4a..a38d2fc 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,8 +1,9 @@ import botApp from './apps/bot'; import adminApp from './apps/admin'; -import { BotConfig } from './types' -import defaultModels from './models' +import { BotConfig } from './types'; +import defaultModels from './models'; +import express from 'express'; export const extendApp = ( app: any, @@ -35,6 +36,10 @@ export const extendApp = ( } } }; + + app.use(express.json()); + app.use(express.urlencoded({extended: true})); + app.use( config.adminRoute, adminApp(mergedHandle, conf)