aboutsummaryrefslogtreecommitdiff
path: root/vnext/server/index.js
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2023-01-21 00:45:21 +0300
committerGravatar Vitaly Takmazov2023-01-21 12:20:01 +0300
commitd24c35089c11f86878e47f855bd5b6a4ef7e340e (patch)
treebd2445073a9577c68e239ca3afd89e6dbde0277b /vnext/server/index.js
parent4c59455fba112f0d7f2ef6ea1a44b3ea702f7a19 (diff)
durov: use webhook
Diffstat (limited to 'vnext/server/index.js')
-rw-r--r--vnext/server/index.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/vnext/server/index.js b/vnext/server/index.js
index 89122069..b4c637bf 100644
--- a/vnext/server/index.js
+++ b/vnext/server/index.js
@@ -10,8 +10,11 @@ import event from './middleware/event';
import oembed from './middleware/oembed';
import urlExpand from './middleware/urlexpand';
+const bot_token = config.get('service.durov.token');
+
const PORT = 8081;
import path from 'path';
+import { webhook } from './durov';
// initialize the application and create the routes
const app = express();
@@ -22,6 +25,7 @@ const router = express.Router();
router.post('/api/sender', event);
router.get('/api/oembed', oembed);
router.get('/api/urlexpand', urlExpand);
+router.post(`/api/${bot_token}`, webhook);
router.use('^/$', serverRenderer);
const STATIC_ROOT = config.get('service.static_root') || path.resolve(__dirname, 'public');