Skip to content

Commit

Permalink
Moved express receiver decoder to code
Browse files Browse the repository at this point in the history
  • Loading branch information
DaKingKong committed Nov 29, 2021
1 parent a5fad1b commit 667e665
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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')
})
Expand Down
9 changes: 7 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -35,6 +36,10 @@ export const extendApp = (
}
}
};

app.use(express.json());
app.use(express.urlencoded({extended: true}));

app.use(
config.adminRoute,
adminApp(mergedHandle, conf)
Expand Down

0 comments on commit 667e665

Please sign in to comment.