From 8bf57c12757dc2c3fdf4513d538ac5abaec498c1 Mon Sep 17 00:00:00 2001 From: Melroy van den Berg Date: Thu, 30 Apr 2020 17:22:00 +0200 Subject: [PATCH] example: update express example bodyParser is built-in again. (#791) See: https://stackoverflow.com/questions/47232187/express-json-vs-bodyparser-json/47232318 --- examples/webhook/express.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/webhook/express.js b/examples/webhook/express.js index b261169..4978e3b 100644 --- a/examples/webhook/express.js +++ b/examples/webhook/express.js @@ -10,7 +10,6 @@ const port = process.env.PORT; const TelegramBot = require('../..'); const express = require('express'); -const bodyParser = require('body-parser'); // No need to pass any parameters as we will handle the updates with Express const bot = new TelegramBot(TOKEN); @@ -21,7 +20,7 @@ bot.setWebHook(`${url}/bot${TOKEN}`); const app = express(); // parse the updates to JSON -app.use(bodyParser.json()); +app.use(express.json()); // We are receiving updates at the route below! app.post(`/bot${TOKEN}`, (req, res) => {