Hello Vercel Community,
I’m seeking assistance to properly set up a Vercel server to handle my application’s logic.
My goal is to allow users to send a series of messages by pressing the enter button. These messages should be bundled together, and then sent to an AI API, which would process the bundle and return a response to the user in the chat.
Here’s how my logic works:
- I’m using Node.js and Express to handle webhooks for incoming events.
- When a message arrives, I store it in an array, timestamp it, and set a
setTimeout()
function for 5 seconds. - If another message arrives within that 5-second window, I clear the timeout, update the timestamp, and continue bundling messages within this custom time gap.
This setup works perfectly on my local machine. However, when I deploy it to Vercel, it behaves inconsistently. Sometimes it doesn’t work at all.
I would greatly appreciate any insights, suggestions, or solutions to resolve this issue on Vercel.
Thank you in advance for your help!
Best regards,
Oleh