aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2022-10-30 01:40:44 +0300
committerGravatar Vitaly Takmazov2023-01-13 10:37:58 +0300
commit62f9875418444274c8aa3785ea913677c203e840 (patch)
tree55b2592103c25f0f58cdb95306c2f7c49f01040f
parent11c8ffc1248edeba1ed9de6221aaf9ef1df75f23 (diff)
Fix routes usage
-rw-r--r--vnext/server/index.js6
-rw-r--r--vnext/server/middleware/event.js3
2 files changed, 4 insertions, 5 deletions
diff --git a/vnext/server/index.js b/vnext/server/index.js
index 5840b586..f9a432b9 100644
--- a/vnext/server/index.js
+++ b/vnext/server/index.js
@@ -13,9 +13,9 @@ const path = require('path');
const app = express();
const router = express.Router();
-router.use('/api/sender', event);
-router.use('/api/oembed', oembed);
-router.use('/api/urlexpand', urlExpand);
+router.post('/api/sender', event);
+router.get('/api/oembed', oembed);
+router.get('/api/urlexpand', urlExpand);
router.use('^/$', serverRenderer);
// other static resources should just be served as they are
diff --git a/vnext/server/middleware/event.js b/vnext/server/middleware/event.js
index 29bede76..54611280 100644
--- a/vnext/server/middleware/event.js
+++ b/vnext/server/middleware/event.js
@@ -41,8 +41,7 @@ function processMessageEvent(msg) {
/**
* Handle new events
*
- * @param {import("next").NextApiRequest} req
- * @param {import("next").NextApiResponse} res
+ * @type {import('express').RequestParamHandler}
*/
export default function handleMessage(req, res) {
return simpleParser(req.body, {})